summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2012-08-24 07:03:03 +0200
committerMichael Roth <mdroth@linux.vnet.ibm.com>2012-08-30 14:54:16 -0500
commitcccb5446a6d1083b51d851ef5a4f1acff9173127 (patch)
treee51006be2e515f1456e44a9626f7c91ce8c334e0
parentmemory: Fix copy&paste mistake in memory_region_iorange_write (diff)
downloadqemu-kvm-cccb5446a6d1083b51d851ef5a4f1acff9173127.tar.gz
qemu-kvm-cccb5446a6d1083b51d851ef5a4f1acff9173127.tar.bz2
qemu-kvm-cccb5446a6d1083b51d851ef5a4f1acff9173127.zip
qemu-ga: Fix null pointer passed to unlink in failure branch
Clang reports this warning: Null pointer passed as an argument to a 'nonnull' parameter Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 4bdb1a3059d7d3a931de0748a2eec39a0ab41b4e) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r--qemu-ga.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/qemu-ga.c b/qemu-ga.c
index e7f9edbc7..1b00c2f44 100644
--- a/qemu-ga.c
+++ b/qemu-ga.c
@@ -439,7 +439,9 @@ static void become_daemon(const char *pidfile)
return;
fail:
- unlink(pidfile);
+ if (pidfile) {
+ unlink(pidfile);
+ }
g_critical("failed to daemonize");
exit(EXIT_FAILURE);
#endif