From 2943d1e20a2a92e118d23efebd81bbbd8e6238b3 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 13 Oct 2009 16:52:05 +0200 Subject: [PATCH] Fix #1352 about double free with regexp and big filenames on windows --- bacula/src/lib/bregex.c | 2 +- bacula/src/lib/smartall.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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; -- 2.39.5