From: Greg Kurz <groug@kaod.org>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Greg Kurz <groug@kaod.org>, ZhiPeng Lu <lu.zhipeng@zte.com.cn>
Subject: [Qemu-devel] [PULL v2 2/4] fsdev: fix memory leak in main()
Date: Tue, 5 Sep 2017 18:00:25 +0200 [thread overview]
Message-ID: <20170905160027.15081-3-groug@kaod.org> (raw)
In-Reply-To: <20170905160027.15081-1-groug@kaod.org>
From: ZhiPeng Lu <lu.zhipeng@zte.com.cn>
@rpath and @sock_name are not freed and leaked.
[groug, not really leaked since the program exits just after that. But it
is always good practice to free allocated memory]
Signed-off-by: Zhipeng Lu <lu.zhipeng@zte.com.cn>
Signed-off-by: Greg Kurz <groug@kaod.org>
---
fsdev/virtfs-proxy-helper.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c
index 6c066ec9a0ce..8e48500dd53a 100644
--- a/fsdev/virtfs-proxy-helper.c
+++ b/fsdev/virtfs-proxy-helper.c
@@ -1162,6 +1162,8 @@ int main(int argc, char **argv)
process_requests(sock);
error:
+ g_free(rpath);
+ g_free(sock_name);
do_log(LOG_INFO, "Done\n");
closelog();
return 0;
--
2.13.5
next prev parent reply other threads:[~2017-09-05 16:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-05 16:00 [Qemu-devel] [PULL v2 0/4] 9pfs/virtfs patches for 2.11 20170905 Greg Kurz
2017-09-05 16:00 ` [Qemu-devel] [PULL v2 1/4] 9pfs: avoid sign conversion error simplifying the code Greg Kurz
2017-09-05 16:00 ` Greg Kurz [this message]
2017-09-05 16:00 ` [Qemu-devel] [PULL v2 3/4] 9pfs: local: clarify fchmodat_nofollow() implementation Greg Kurz
2017-09-05 16:00 ` [Qemu-devel] [PULL v2 4/4] virtfs: error out gracefully when mandatory suboptions are missing Greg Kurz
2017-09-05 17:12 ` [Qemu-devel] [PULL v2 0/4] 9pfs/virtfs patches for 2.11 20170905 Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170905160027.15081-3-groug@kaod.org \
--to=groug@kaod.org \
--cc=lu.zhipeng@zte.com.cn \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).