Skip to content

Commit

Permalink
qemu-ga: Fix null pointer passed to unlink in failure branch
Browse files Browse the repository at this point in the history
Clang reports this warning:

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

Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
  • Loading branch information
stweil authored and Anthony Liguori committed Aug 29, 2012
1 parent 7e2a62d commit 4bdb1a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion qemu-ga.c
Expand Up @@ -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
Expand Down

0 comments on commit 4bdb1a3

Please sign in to comment.