]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu_driver.c: don't unlink(NULL) on OOM error path
authorJim Meyering <meyering@redhat.com>
Mon, 14 Dec 2009 15:41:11 +0000 (16:41 +0100)
committerJim Meyering <meyering@redhat.com>
Tue, 15 Dec 2009 10:26:24 +0000 (11:26 +0100)
* src/qemu/qemu_driver.c (qemudDomainMigratePrepareTunnel): Upon an
out of memory error, we would end up with unixfile==NULL and attempt
to unlink(NULL).  Skip the unlink when it's NULL.

src/qemu/qemu_driver.c

index 56bcec5ffe580c21b21b00e2e22e0c3ae7408144..c782f0dab913fa74bf862d1e77b18b3a9a61716b 100644 (file)
@@ -6903,7 +6903,8 @@ endjob:
 
 cleanup:
     virDomainDefFree(def);
-    unlink(unixfile);
+    if (unixfile)
+        unlink(unixfile);
     VIR_FREE(unixfile);
     if (vm)
         virDomainObjUnlock(vm);