From: Eric Blake Date: Fri, 22 Oct 2010 16:22:20 +0000 (-0600) Subject: dnsmasq: avoid potential crash X-Git-Tag: v0.8.5~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24a2663f70e336326d6054c626934927fd2a9528;p=thirdparty%2Flibvirt.git dnsmasq: avoid potential crash * src/util/dnsmasq.c (hostsfileAdd): Don't free uninitialized memory on allocation failure. --- diff --git a/src/util/dnsmasq.c b/src/util/dnsmasq.c index 2cb25bf8f2..3c0506cdaa 100644 --- a/src/util/dnsmasq.c +++ b/src/util/dnsmasq.c @@ -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;