]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix #1352 about double free with regexp and big filenames on windows
authorEric Bollengier <eric@eb.homelinux.org>
Tue, 13 Oct 2009 14:52:05 +0000 (16:52 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Tue, 13 Oct 2009 14:56:00 +0000 (16:56 +0200)
bacula/src/lib/bregex.c
bacula/src/lib/smartall.c

index d955737d2c0cda979e583efe4663e43847349a54..1e4b3ac5a418c011d107ee9668203682a70ab81f 100644 (file)
@@ -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++);
index acc27295aeb2615d1f17dd68a4d262fd7d5a8a5b..be56a417a1c8081d0f6d81a4d1ae212fbd782b43 100644 (file)
@@ -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;