* [PATCH] tools/libxc: Fix memory leaks in xc_domain_save()
@ 2013-06-24 15:47 Andrew Cooper
2013-06-25 9:18 ` George Dunlap
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cooper @ 2013-06-24 15:47 UTC (permalink / raw)
To: xen-devel; +Cc: George Dunlap, Ian Jackson, Ian Campbell
Introduces outbuf_free() to mirror the currently existing outbuf_init().
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
--
George: Same comment regarding consideration for 4.3
Ian: This should be considered for backporting to 4.2 and 4.1 as well
diff -r 803ad8977a81 -r 6f255399bd67 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c
+++ b/tools/libxc/xc_domain_save.c
@@ -139,6 +139,13 @@ static int outbuf_init(xc_interface *xch
return 0;
}
+static int outbuf_free(struct outbuf *ob)
+{
+ free(ob->buf);
+ ob->buf = NULL;
+ return 0;
+}
+
static inline int outbuf_write(xc_interface *xch,
struct outbuf* ob, void* buf, size_t len)
{
@@ -2122,6 +2129,8 @@ int xc_domain_save(xc_interface *xch, in
free(pfn_batch);
free(pfn_err);
free(to_fix);
+ free(hvm_buf);
+ outbuf_free(&ob_pagebuf);
DPRINTF("Save exit of domid %u with rc=%d\n", dom, rc);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] tools/libxc: Fix memory leaks in xc_domain_save()
2013-06-24 15:47 [PATCH] tools/libxc: Fix memory leaks in xc_domain_save() Andrew Cooper
@ 2013-06-25 9:18 ` George Dunlap
2013-06-26 16:23 ` Ian Campbell
0 siblings, 1 reply; 3+ messages in thread
From: George Dunlap @ 2013-06-25 9:18 UTC (permalink / raw)
To: Andrew Cooper; +Cc: Ian Jackson, Ian Campbell, xen-devel
On 06/24/2013 04:47 PM, Andrew Cooper wrote:
> Introduces outbuf_free() to mirror the currently existing outbuf_init().
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Both re the release and the content:
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] tools/libxc: Fix memory leaks in xc_domain_save()
2013-06-25 9:18 ` George Dunlap
@ 2013-06-26 16:23 ` Ian Campbell
0 siblings, 0 replies; 3+ messages in thread
From: Ian Campbell @ 2013-06-26 16:23 UTC (permalink / raw)
To: George Dunlap; +Cc: Andrew Cooper, Ian Jackson, xen-devel
On Tue, 2013-06-25 at 10:18 +0100, George Dunlap wrote:
> On 06/24/2013 04:47 PM, Andrew Cooper wrote:
> > Introduces outbuf_free() to mirror the currently existing outbuf_init().
> >
> > Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> Both re the release and the content:
>
> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked + applied to unstable.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-06-26 16:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-24 15:47 [PATCH] tools/libxc: Fix memory leaks in xc_domain_save() Andrew Cooper
2013-06-25 9:18 ` George Dunlap
2013-06-26 16:23 ` Ian Campbell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.