提交 03ac10f1 编写于 作者: M Markus Armbruster 提交者: Michael Roth

qemu-ga: Plug file descriptor leak on ga_open_pidfile() error path

Spotted by Coverity.  Also document why we keep it open on success.
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Reviewed-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: NLuiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
上级 5d27f9ce
......@@ -299,10 +299,12 @@ static bool ga_open_pidfile(const char *pidfile)
goto fail;
}
/* keep pidfile open & locked forever */
return true;
fail:
unlink(pidfile);
close(pidfd);
return false;
}
#else /* _WIN32 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册