Commit d55f81f5 authored by Simon Kelley's avatar Simon Kelley

Zero newly malloc'ed memory.

parent 294d36df
...@@ -248,6 +248,8 @@ void *safe_malloc(size_t size) ...@@ -248,6 +248,8 @@ void *safe_malloc(size_t size)
if (!ret) if (!ret)
die(_("could not get memory"), NULL, EC_NOMEM); die(_("could not get memory"), NULL, EC_NOMEM);
else
memset(ret, 0, size);
return ret; return ret;
} }
...@@ -266,7 +268,9 @@ void *whine_malloc(size_t size) ...@@ -266,7 +268,9 @@ void *whine_malloc(size_t size)
if (!ret) if (!ret)
my_syslog(LOG_ERR, _("failed to allocate %d bytes"), (int) size); my_syslog(LOG_ERR, _("failed to allocate %d bytes"), (int) size);
else
memset(ret, 0, size);
return ret; return ret;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment