提交 cccb5446 编写于 作者: S Stefan Weil 提交者: Michael Roth

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: NLuiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: NStefan Weil <sw@weilnetz.de>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 4bdb1a30)
Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
上级 25c0807e
......@@ -439,7 +439,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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册