aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qemu-ga.c4
1 files changed, 3 insertions, 1 deletions
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