git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4676
91ce42f0-d328-0410-95d8-
f526ca767f89
alloc = bufp->allocated;
if (alloc == 0 || pattern == NULL) {
alloc = 256;
- pattern = (unsigned char *)malloc(alloc);
+ bufp->buffer = pattern = (unsigned char *)malloc(alloc);
if (!pattern)
goto out_of_memory;
}
free_pool_memory(preg->lcase);
preg->lcase = NULL;
}
+ if (preg->buffer) {
+ free(preg->buffer);
+ preg->buffer = NULL;
+ }
}
int re_match(regex_t * bufp, unsigned char *string, int size, int pos,