* [PATCH] tools/libxc: Fix memory leaks in xc_domain_restore()
@ 2013-06-21 16:36 Andrew Cooper
2013-06-21 17:27 ` Ian Jackson
2013-06-24 10:19 ` [PATCH] tools/libxc: Fix memory leaks in xc_domain_restore() George Dunlap
0 siblings, 2 replies; 5+ messages in thread
From: Andrew Cooper @ 2013-06-21 16:36 UTC (permalink / raw)
To: xen-devel; +Cc: George Dunlap, Ian Jackson, Ian Campbell
# HG changeset patch
# User Andrew Cooper <andrew.cooper3@citrix.com>
# Date 1371832526 -3600
# Node ID cec58839d6eff0ac27de3827af8fc969db554172
# Parent 803ad8977a817263ea826bac1bb68c0dd57fac9c
tools/libxc: Fix memory leaks in xc_domain_restore()
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
George: I believe these qualify under #2 for inclusion into 4.3
Ian: These should be backported to 4.2 and 4.1
I will have a patch against xc_domain_save() soon, but it is proving more
difficult and I am not certain I will have time to finish it soon.
diff -r 803ad8977a81 -r cec58839d6ef tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c
+++ b/tools/libxc/xc_domain_restore.c
@@ -2335,6 +2335,9 @@ int xc_domain_restore(xc_interface *xch,
free(mmu);
free(ctx->p2m);
free(pfn_type);
+ free(region_mfn);
+ free(ctx->p2m_batch);
+ pagebuf_free(&pagebuf);
tailbuf_free(&tailbuf);
/* discard cache for save file */
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] tools/libxc: Fix memory leaks in xc_domain_restore()
2013-06-21 16:36 [PATCH] tools/libxc: Fix memory leaks in xc_domain_restore() Andrew Cooper
@ 2013-06-21 17:27 ` Ian Jackson
2013-06-21 17:30 ` Andrew Cooper
2013-06-24 10:19 ` [PATCH] tools/libxc: Fix memory leaks in xc_domain_restore() George Dunlap
1 sibling, 1 reply; 5+ messages in thread
From: Ian Jackson @ 2013-06-21 17:27 UTC (permalink / raw)
To: Andrew Cooper; +Cc: George Dunlap, Ian Campbell, xen-devel
Andrew Cooper writes ("[PATCH] tools/libxc: Fix memory leaks in xc_domain_restore()"):
> tools/libxc: Fix memory leaks in xc_domain_restore()
> + free(region_mfn);
...
> + pagebuf_free(&pagebuf);
These look correct to me.
But as regards
> + free(ctx->p2m_batch);
It's not clear to me where that's initialised. It needs to be
initialised to NULL I think.
Ian.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] tools/libxc: Fix memory leaks in xc_domain_restore()
2013-06-21 17:27 ` Ian Jackson
@ 2013-06-21 17:30 ` Andrew Cooper
2013-06-24 13:12 ` [PATCH] tools/libxc: Fix memory leaks in xc_domain_restore() [and 1 more messages] Ian Jackson
0 siblings, 1 reply; 5+ messages in thread
From: Andrew Cooper @ 2013-06-21 17:30 UTC (permalink / raw)
To: Ian Jackson; +Cc: George Dunlap, Ian Campbell, xen-devel
On 21/06/13 18:27, Ian Jackson wrote:
> Andrew Cooper writes ("[PATCH] tools/libxc: Fix memory leaks in xc_domain_restore()"):
>> tools/libxc: Fix memory leaks in xc_domain_restore()
>> + free(region_mfn);
> ...
>> + pagebuf_free(&pagebuf);
> These look correct to me.
>
> But as regards
>
>> + free(ctx->p2m_batch);
> It's not clear to me where that's initialised. It needs to be
> initialised to NULL I think.
>
> Ian.
It is initialised in memset(ctx, 0, sizeof(*ctx)) at the top of the
function.
~Andrew
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] tools/libxc: Fix memory leaks in xc_domain_restore() [and 1 more messages]
2013-06-21 17:30 ` Andrew Cooper
@ 2013-06-24 13:12 ` Ian Jackson
0 siblings, 0 replies; 5+ messages in thread
From: Ian Jackson @ 2013-06-24 13:12 UTC (permalink / raw)
To: George Dunlap, Andrew Cooper; +Cc: Ian Campbell, xen-devel
Andrew Cooper writes ("Re: [PATCH] tools/libxc: Fix memory leaks in xc_domain_restore()"):
> On 21/06/13 18:27, Ian Jackson wrote:
> > It's not clear to me where that's initialised. It needs to be
> > initialised to NULL I think.
...
> It is initialised in memset(ctx, 0, sizeof(*ctx)) at the top of the
> function.
Oh, yes.
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
George Dunlap writes ("Re: [Xen-devel] [PATCH] tools/libxc: Fix memory leaks in> Re the release:
>
> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Thanks, committed.
Ian.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] tools/libxc: Fix memory leaks in xc_domain_restore()
2013-06-21 16:36 [PATCH] tools/libxc: Fix memory leaks in xc_domain_restore() Andrew Cooper
2013-06-21 17:27 ` Ian Jackson
@ 2013-06-24 10:19 ` George Dunlap
1 sibling, 0 replies; 5+ messages in thread
From: George Dunlap @ 2013-06-24 10:19 UTC (permalink / raw)
To: Andrew Cooper; +Cc: Ian Jackson, Ian Campbell, xen-devel@lists.xen.org
On Fri, Jun 21, 2013 at 5:36 PM, Andrew Cooper
<andrew.cooper3@citrix.com> wrote:
> # HG changeset patch
> # User Andrew Cooper <andrew.cooper3@citrix.com>
> # Date 1371832526 -3600
> # Node ID cec58839d6eff0ac27de3827af8fc969db554172
> # Parent 803ad8977a817263ea826bac1bb68c0dd57fac9c
> tools/libxc: Fix memory leaks in xc_domain_restore()
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> ---
>
> George: I believe these qualify under #2 for inclusion into 4.3
Yes, looks good:
Re the release:
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
>
> Ian: These should be backported to 4.2 and 4.1
>
> I will have a patch against xc_domain_save() soon, but it is proving more
> difficult and I am not certain I will have time to finish it soon.
>
> diff -r 803ad8977a81 -r cec58839d6ef tools/libxc/xc_domain_restore.c
> --- a/tools/libxc/xc_domain_restore.c
> +++ b/tools/libxc/xc_domain_restore.c
> @@ -2335,6 +2335,9 @@ int xc_domain_restore(xc_interface *xch,
> free(mmu);
> free(ctx->p2m);
> free(pfn_type);
> + free(region_mfn);
> + free(ctx->p2m_batch);
> + pagebuf_free(&pagebuf);
> tailbuf_free(&tailbuf);
>
> /* discard cache for save file */
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-06-24 13:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-21 16:36 [PATCH] tools/libxc: Fix memory leaks in xc_domain_restore() Andrew Cooper
2013-06-21 17:27 ` Ian Jackson
2013-06-21 17:30 ` Andrew Cooper
2013-06-24 13:12 ` [PATCH] tools/libxc: Fix memory leaks in xc_domain_restore() [and 1 more messages] Ian Jackson
2013-06-24 10:19 ` [PATCH] tools/libxc: Fix memory leaks in xc_domain_restore() George Dunlap
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).