From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: mdroth@linux.vnet.ibm.com, lcapitulino@redhat.com
Subject: [Qemu-devel] [PATCH 1/2] qemu-ga: Plug memory leak in guest_fsfreeze_cleanup()
Date: Wed, 16 Jan 2013 18:15:08 +0100 [thread overview]
Message-ID: <1358356509-28742-2-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1358356509-28742-1-git-send-email-armbru@redhat.com>
Neglects to free errors allocated by qmp_guest_fsfreeze_thaw().
Spotted by Coverity.
While there, drop the test whether return value is negative (it's
never true), and improve logging.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
qga/commands-posix.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 77f6ee7..f95ebc8 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -611,13 +611,14 @@ int64_t qmp_guest_fsfreeze_thaw(Error **err)
static void guest_fsfreeze_cleanup(void)
{
- int64_t ret;
Error *err = NULL;
if (ga_is_frozen(ga_state) == GUEST_FSFREEZE_STATUS_FROZEN) {
- ret = qmp_guest_fsfreeze_thaw(&err);
- if (ret < 0 || err) {
- slog("failed to clean up frozen filesystems");
+ qmp_guest_fsfreeze_thaw(&err);
+ if (err) {
+ slog("failed to clean up frozen filesystems: %s",
+ error_get_pretty(err));
+ error_free(err);
}
}
}
--
1.7.11.7
next prev parent reply other threads:[~2013-01-16 17:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-16 17:15 [Qemu-devel] [PATCH 0/2] qemu-ga: Plug a few leaks Markus Armbruster
2013-01-16 17:15 ` Markus Armbruster [this message]
2013-01-16 17:15 ` [Qemu-devel] [PATCH 2/2] qemu-ga: Plug leaks on qmp_guest_network_get_interfaces() error paths Markus Armbruster
2013-01-16 18:46 ` Luiz Capitulino
2013-01-16 18:08 ` [Qemu-devel] [PATCH 0/2] qemu-ga: Plug a few leaks Eric Blake
2013-01-16 18:46 ` Luiz Capitulino
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=1358356509-28742-2-git-send-email-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--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).