Fixed a memory leak.

This commit is contained in:
Ilia Alshanetsky 2002-11-12 17:41:26 +00:00
parent 0f2ae50178
commit d84afe1121

View File

@ -1446,6 +1446,9 @@ re_compile_pattern(pattern, size, bufp)
snprintf(error_msg, ERROR_MSG_MAX_SIZE,
"invalid regular expression; there's no previous pattern, to which '%c' would define cardinality at %d",
c, p-pattern);
if (bufp->buffer) {
xfree(bufp->buffer);
}
FREE_AND_RETURN(stackb, error_msg);
}
/* If there is a sequence of repetition chars,