mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-11-25 20:38:36 +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)
|
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)
|
|||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user