mirror of https://gitee.com/openkylin/libvirt.git
dnsmasq: avoid potential crash
* src/util/dnsmasq.c (hostsfileAdd): Don't free uninitialized memory on allocation failure.
This commit is contained in:
parent
450c20ea3d
commit
24a2663f70
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue