Commit 4bdb1a30 authored by Stefan Weil's avatar Stefan Weil Committed by Anthony Liguori

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: default avatarLuiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: default avatarStefan Weil <sw@weilnetz.de>
Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
parent 7e2a62d8
...@@ -438,7 +438,9 @@ static void become_daemon(const char *pidfile) ...@@ -438,7 +438,9 @@ static void become_daemon(const char *pidfile)
return; return;
fail: fail:
unlink(pidfile); if (pidfile) {
unlink(pidfile);
}
g_critical("failed to daemonize"); g_critical("failed to daemonize");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
#endif #endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment