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)
|
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