From: Kern Sibbald Date: Sat, 15 Aug 2020 12:56:35 +0000 (+0200) Subject: zero malloced memory when SMARTALLOC not enabled X-Git-Tag: Release-9.6.6~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fa937b619fb5a11297e45c2276e3f7944235e91;p=thirdparty%2Fbacula.git zero malloced memory when SMARTALLOC not enabled --- diff --git a/bacula/src/lib/bsys.c b/bacula/src/lib/bsys.c index 0122b23e7..34eda7145 100644 --- a/bacula/src/lib/bsys.c +++ b/bacula/src/lib/bsys.c @@ -362,6 +362,7 @@ void *bmalloc(size_t size) buf = sm_malloc(file, line, size); #else buf = malloc(size); + memset(buf, 0, size); /* clear memory */ #endif if (buf == NULL) { berrno be; @@ -379,6 +380,7 @@ void *b_malloc(const char *file, int line, size_t size) buf = sm_malloc(file, line, size); #else buf = malloc(size); + memset(buf, 0, size); /* clear memory */ #endif if (buf == NULL) { berrno be;