dnsmasq: avoid potential crash

* src/util/dnsmasq.c (hostsfileAdd): Don't free uninitialized
memory on allocation failure.
This commit is contained in:
Eric Blake 2010-10-22 10:22:20 -06:00
parent 450c20ea3d
commit 24a2663f70
1 changed files with 1 additions and 1 deletions

View File

@ -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;