From: Jim Meyering Date: Mon, 14 Dec 2009 15:41:11 +0000 (+0100) Subject: qemu_driver.c: don't unlink(NULL) on OOM error path X-Git-Tag: v0.7.5~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1428704d2a8860f3c9feb96dd1eb38c1f7bff7e8;p=thirdparty%2Flibvirt.git qemu_driver.c: don't unlink(NULL) on OOM error path * 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. --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 56bcec5ffe..c782f0dab9 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -6903,7 +6903,8 @@ endjob: cleanup: virDomainDefFree(def); - unlink(unixfile); + if (unixfile) + unlink(unixfile); VIR_FREE(unixfile); if (vm) virDomainObjUnlock(vm);