From 4bdb1a3059d7d3a931de0748a2eec39a0ab41b4e Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Fri, 24 Aug 2012 07:03:03 +0200 Subject: 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 --- qemu-ga.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'qemu-ga.c') 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 -- cgit v1.2.3