提交 24a2663f 编写于 作者: E Eric Blake

dnsmasq: avoid potential crash

* src/util/dnsmasq.c (hostsfileAdd): Don't free uninitialized
memory on allocation failure.
上级 450c20ea
......@@ -79,7 +79,7 @@ hostsfileAdd(dnsmasqHostsfile *hostsfile,
virSocketAddr *ip,
const char *name)
{
char *ipstr;
char *ipstr = NULL;
if (VIR_REALLOC_N(hostsfile->hosts, hostsfile->nhosts + 1) < 0)
goto alloc_error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册