aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2010-10-22 10:22:20 -0600
committerEric Blake <eblake@redhat.com>2010-10-22 10:22:20 -0600
commit24a2663f70e336326d6054c626934927fd2a9528 (patch)
tree18cd30dcae971f857d7644e8ca19a15c6bafc0bd
parentdocs: added a table of contents to the new c sharp bindings page (diff)
downloadlibvirt-24a2663f70e336326d6054c626934927fd2a9528.tar.gz
libvirt-24a2663f70e336326d6054c626934927fd2a9528.tar.bz2
libvirt-24a2663f70e336326d6054c626934927fd2a9528.zip
dnsmasq: avoid potential crash
* src/util/dnsmasq.c (hostsfileAdd): Don't free uninitialized memory on allocation failure.
-rw-r--r--src/util/dnsmasq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/dnsmasq.c b/src/util/dnsmasq.c
index 2cb25bf8f..3c0506cda 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;