mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-10-19 11:19:34 +00:00
Zero newly malloc'ed memory.
This commit is contained in:
1 parent
294d36df47
commit
d55f81f5fd
1 file changed
+5
-1
+5
-1
@@ -248,6 +248,8 @@ void *safe_malloc(size_t size)
|
||||
|
||||
if (!ret)
|
||||
die(_("could not get memory"), NULL, EC_NOMEM);
|
||||
else
|
||||
memset(ret, 0, size);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -266,7 +268,9 @@ void *whine_malloc(size_t size)
|
||||
|
||||
if (!ret)
|
||||
my_syslog(LOG_ERR, _("failed to allocate %d bytes"), (int) size);
|
||||
|
||||
else
|
||||
memset(ret, 0, size);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user