i++;
}
#ifndef TRE_USE_ALLOCA
- if (tags != intags) xfree(tags);
+ if (tags != intags) xfree((void*)tags);
#endif /* !TRE_USE_ALLOCA */
}
tre_tag_t *tags = NULL;
int eo;
size_t offset = 0, count = 0;
- if (tnfa->num_tags > 0 && nmatch > 0)
- {
-#ifdef TRE_USE_ALLOCA
- tags = alloca(sizeof(*tags) * tnfa->num_tags);
-#else /* !TRE_USE_ALLOCA */
- tags = xmalloc(sizeof(*tags) * tnfa->num_tags);
-#endif /* !TRE_USE_ALLOCA */
- if (tags == NULL)
- return REG_ESPACE;
- }
if (
#ifdef TRE_STR_USER
if (type == STR_WIDE) offset *= sizeof(wchar_t);
}
+ if (tnfa->num_tags > 0 && nmatch > 0)
+ {
+#ifdef TRE_USE_ALLOCA
+ tags = alloca(sizeof(*tags) * tnfa->num_tags);
+#else /* !TRE_USE_ALLOCA */
+ tags = xmalloc(sizeof(*tags) * tnfa->num_tags);
+#endif /* !TRE_USE_ALLOCA */
+ if (tags == NULL)
+ return REG_ESPACE;
+ }
+
/* Dispatch to the appropriate matcher. */
if (tnfa->have_backrefs || eflags & REG_BACKTRACKING_MATCHER)
{
if (source->rewind == NULL || source->compare == NULL)
/* The backtracking matcher requires rewind and compare
capabilities from the input stream. */
- return REG_BADPAT;
- }
+ status = REG_BADPAT;
+ } else
#endif /* TRE_STR_USER */
status = tre_tnfa_run_backtrack(tnfa, string + offset, (int)len, type,
tags, eflags, &eo);