]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuDomainAttach: Initialize pidfile variable
authorMichal Privoznik <mprivozn@redhat.com>
Sun, 9 Oct 2011 08:42:42 +0000 (10:42 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Sun, 9 Oct 2011 08:42:42 +0000 (10:42 +0200)
If parsing qemu command line fails (e.g. because of non-existing
process number supplied), we jump to cleanup label where we free
pidfile. Therefore it needs to be initialized. Otherwise we free
random pointer.

src/qemu/qemu_driver.c

index 2e6f3e4212c861c3e8dad54bcdbbb522cada4ab1..5588d93faf7d2bb6b55b5f0d176621a6026fe969 100644 (file)
@@ -10179,7 +10179,7 @@ static virDomainPtr qemuDomainAttach(virConnectPtr conn,
     virDomainPtr dom = NULL;
     virDomainChrSourceDefPtr monConfig = NULL;
     bool monJSON = false;
-    char *pidfile;
+    char *pidfile = NULL;
 
     virCheckFlags(0, NULL);