qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-trivial] [PATCH for 1.2] qemu-ga: Fix null pointer passed to unlin


From: Stefan Weil
Subject: [Qemu-trivial] [PATCH for 1.2] qemu-ga: Fix null pointer passed to unlink in failure branch
Date: Fri, 24 Aug 2012 07:03:03 +0200

Clang reports this warning:

Null pointer passed as an argument to a 'nonnull' parameter

Signed-off-by: Stefan Weil <address@hidden>
---
 qemu-ga.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/qemu-ga.c b/qemu-ga.c
index 26671fe..7623079 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
-- 
1.7.10




reply via email to

[Prev in Thread] Current Thread [Next in Thread]