qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qcow2: free old snapshots array upon creation of a new one
@ 2009-01-05  0:52 Uri Lublin
  2009-01-07 16:54 ` Anthony Liguori
  0 siblings, 1 reply; 4+ messages in thread
From: Uri Lublin @ 2009-01-05  0:52 UTC (permalink / raw)
  To: qemu-devel

Don't leak memory

Signed-off-by: Uri Lublin <uril@redhat.com>
---
  qemu/block-qcow2.c |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/qemu/block-qcow2.c b/qemu/block-qcow2.c
index b3b5f8f..4a2d0a3 100644
--- a/qemu/block-qcow2.c
+++ b/qemu/block-qcow2.c
@@ -2021,6 +2021,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 related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] qcow2: free old snapshots array upon creation of a new one
  2009-01-05  0:52 [Qemu-devel] [PATCH] qcow2: free old snapshots array upon creation of a new one Uri Lublin
@ 2009-01-07 16:54 ` Anthony Liguori
  2009-01-07 17:27   ` Johannes Schindelin
  0 siblings, 1 reply; 4+ messages in thread
From: Anthony Liguori @ 2009-01-07 16:54 UTC (permalink / raw)
  To: qemu-devel

Uri Lublin wrote:
> Don't leak memory
>
> Signed-off-by: Uri Lublin <uril@redhat.com>
> ---
>  qemu/block-qcow2.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)

Please don't send patches against kvm-userspace.

Regards,

Anthony Liguori

> diff --git a/qemu/block-qcow2.c b/qemu/block-qcow2.c
> index b3b5f8f..4a2d0a3 100644
> --- a/qemu/block-qcow2.c
> +++ b/qemu/block-qcow2.c
> @@ -2021,6 +2021,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] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] qcow2: free old snapshots array upon creation of a new one
  2009-01-07 16:54 ` Anthony Liguori
@ 2009-01-07 17:27   ` Johannes Schindelin
  2009-01-08 13:52     ` Avi Kivity
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Schindelin @ 2009-01-07 17:27 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: qemu-devel

Hi,

On Wed, 7 Jan 2009, Anthony Liguori wrote:

> Uri Lublin wrote:
> > Don't leak memory
> >
> > Signed-off-by: Uri Lublin <uril@redhat.com>
> > ---
> >  qemu/block-qcow2.c |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> Please don't send patches against kvm-userspace.

git am -p2 <mbox>

Hth,
Dscho

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] qcow2: free old snapshots array upon creation of a new one
  2009-01-07 17:27   ` Johannes Schindelin
@ 2009-01-08 13:52     ` Avi Kivity
  0 siblings, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2009-01-08 13:52 UTC (permalink / raw)
  To: qemu-devel

Johannes Schindelin wrote:
> Hi,
>
> On Wed, 7 Jan 2009, Anthony Liguori wrote:
>
>   
>> Uri Lublin wrote:
>>     
>>> Don't leak memory
>>>
>>> Signed-off-by: Uri Lublin <uril@redhat.com>
>>> ---
>>>  qemu/block-qcow2.c |    1 +
>>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>>       
>> Please don't send patches against kvm-userspace.
>>     
>
> git am -p2 <mbox>
>   

That doesn't test the patch against upstream qemu.

-- 
error compiling committee.c: too many arguments to function

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-01-08 13:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-05  0:52 [Qemu-devel] [PATCH] qcow2: free old snapshots array upon creation of a new one Uri Lublin
2009-01-07 16:54 ` Anthony Liguori
2009-01-07 17:27   ` Johannes Schindelin
2009-01-08 13:52     ` Avi Kivity

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).