From 24a2663f70e336326d6054c626934927fd2a9528 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Fri, 22 Oct 2010 10:22:20 -0600 Subject: [PATCH] dnsmasq: avoid potential crash * src/util/dnsmasq.c (hostsfileAdd): Don't free uninitialized memory on allocation failure. --- src/util/dnsmasq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- GitLab