]> xenbits.xensource.com Git - libvirt.git/commitdiff
dnsmasq: avoid potential crash
authorEric Blake <eblake@redhat.com>
Fri, 22 Oct 2010 16:22:20 +0000 (10:22 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 22 Oct 2010 16:22:20 +0000 (10:22 -0600)
* src/util/dnsmasq.c (hostsfileAdd): Don't free uninitialized
memory on allocation failure.

src/util/dnsmasq.c

index 2cb25bf8f24ddc326a8c83d0f685d7d44e7900b6..3c0506cdaa124ae667304d768883ae4b26a38166 100644 (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;