[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH for 1.2] qemu-ga: Fix null pointer passed to unlink
From: |
Stefan Weil |
Subject: |
[Qemu-devel] [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
- [Qemu-devel] [PATCH for 1.2] qemu-ga: Fix null pointer passed to unlink in failure branch,
Stefan Weil <=