]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
zero malloced memory when SMARTALLOC not enabled
authorKern Sibbald <kern@sibbald.com>
Sat, 15 Aug 2020 12:56:35 +0000 (14:56 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 15 Aug 2020 12:56:35 +0000 (14:56 +0200)
bacula/src/lib/bsys.c

index 0122b23e73c335043103637a949202230816a504..34eda7145473c9eb867c6739ddee2a17845583e6 100644 (file)
@@ -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;