mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Zero newly malloc'ed memory.
This commit is contained in:
@@ -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,6 +268,8 @@ 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