From: Eric Bollengier Date: Tue, 13 Oct 2009 14:52:05 +0000 (+0200) Subject: Fix #1352 about double free with regexp and big filenames on windows X-Git-Tag: Release-7.0.0~2602^2~10 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=206a9014ad50f50187807f664ff00d92e17d413c;p=bacula%2Fbacula Fix #1352 about double free with regexp and big filenames on windows --- diff --git a/bacula/src/lib/bregex.c b/bacula/src/lib/bregex.c index d955737d2c..1e4b3ac5a4 100644 --- a/bacula/src/lib/bregex.c +++ b/bacula/src/lib/bregex.c @@ -1943,7 +1943,7 @@ int re_search(regex_t * bufp, unsigned char *str, int size, int pos, if (!bufp->lcase) { bufp->lcase = get_pool_memory(PM_FNAME); } - check_pool_memory_size(bufp->lcase, len+1); + bufp->lcase = check_pool_memory_size(bufp->lcase, len+1); unsigned char *dst = (unsigned char *)bufp->lcase; while (*string) { *dst++ = tolower(*string++); diff --git a/bacula/src/lib/smartall.c b/bacula/src/lib/smartall.c index acc27295ae..be56a417a1 100644 --- a/bacula/src/lib/smartall.c +++ b/bacula/src/lib/smartall.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2000-2008 Free Software Foundation Europe e.V. + Copyright (C) 2000-2009 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -187,7 +187,7 @@ void sm_free(const char *file, int line, void *fp) struct abufhead *head = (struct abufhead *)cp; P(mutex); - Dmsg4(1150, "sm_free %d at %x from %s:%d\n", + Dmsg4(1150, "sm_free %d at %p from %s:%d\n", head->ablen, fp, head->abfname, head->ablineno); @@ -327,7 +327,7 @@ void *sm_realloc(const char *fname, int lineno, void *ptr, unsigned int size) } /* All done. Free and dechain the original buffer. */ - sm_free(__FILE__, __LINE__, ptr); + sm_free(fname, lineno, ptr); } Dmsg4(150, _("sm_realloc %d at %x from %s:%d\n"), size, buf, fname, lineno); return buf;