From: Stefan Weil Date: Fri, 24 Aug 2012 05:03:03 +0000 (+0200) Subject: qemu-ga: Fix null pointer passed to unlink in failure branch X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4bdb1a3059d7d3a931de0748a2eec39a0ab41b4e;p=qemu.git 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 Signed-off-by: Stefan Weil Signed-off-by: Anthony Liguori --- diff --git a/qemu-ga.c b/qemu-ga.c index 26671fee3f..7623079887 100644 --- a/qemu-ga.c +++ b/qemu-ga.c @@ -438,7 +438,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