* [Qemu-devel] [PATCH v2] qcow2: free old snapshots array upon creation of a new one
@ 2009-01-08 18:09 Uri Lublin
2009-01-08 19:32 ` Anthony Liguori
0 siblings, 1 reply; 2+ messages in thread
From: Uri Lublin @ 2009-01-08 18:09 UTC (permalink / raw)
To: qemu-devel; +Cc: Uri Lublin
From: Uri Lublin <uril@redhat.com>
Don't leak memory
Rebased for qemu tree.
Signed-off-by: Uri Lublin <uril@redhat.com>
---
block-qcow2.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/block-qcow2.c b/block-qcow2.c
index 707109e..9aa7261 100644
--- a/block-qcow2.c
+++ b/block-qcow2.c
@@ -2024,6 +2024,7 @@ static int qcow_snapshot_create(BlockDriverState *bs,
if (!snapshots1)
goto fail;
memcpy(snapshots1, s->snapshots, s->nb_snapshots * sizeof(QCowSnapshot));
+ qemu_free(s->snapshots);
s->snapshots = snapshots1;
s->snapshots[s->nb_snapshots++] = *sn;
--
1.6.0.6
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH v2] qcow2: free old snapshots array upon creation of a new one
2009-01-08 18:09 [Qemu-devel] [PATCH v2] qcow2: free old snapshots array upon creation of a new one Uri Lublin
@ 2009-01-08 19:32 ` Anthony Liguori
0 siblings, 0 replies; 2+ messages in thread
From: Anthony Liguori @ 2009-01-08 19:32 UTC (permalink / raw)
To: qemu-devel; +Cc: Uri Lublin
Uri Lublin wrote:
> From: Uri Lublin <uril@redhat.com>
>
> Don't leak memory
>
> Rebased for qemu tree.
>
> Signed-off-by: Uri Lublin <uril@redhat.com>
Applied. Well, sort of. It appears to be whitespace damaged and didn't
apply. It was simple enough that I just made the change manually though.
Regards,
Anthony Liguori
> ---
> block-qcow2.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/block-qcow2.c b/block-qcow2.c
> index 707109e..9aa7261 100644
> --- a/block-qcow2.c
> +++ b/block-qcow2.c
> @@ -2024,6 +2024,7 @@ static int qcow_snapshot_create(BlockDriverState
> *bs,
> if (!snapshots1)
> goto fail;
> memcpy(snapshots1, s->snapshots, s->nb_snapshots *
> sizeof(QCowSnapshot));
> + qemu_free(s->snapshots);
> s->snapshots = snapshots1;
> s->snapshots[s->nb_snapshots++] = *sn;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-01-08 19:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-08 18:09 [Qemu-devel] [PATCH v2] qcow2: free old snapshots array upon creation of a new one Uri Lublin
2009-01-08 19:32 ` Anthony Liguori
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).