qcow2: free old snapshots array upon creation of a new one
PATCH v2 1/1 qcow2: free old snapshots array upon creation of a new one
From: Uri Lublin <[email protected]>
Don't leak memory
Rebased for qemu tree.
Signed-off-by Uri Lublin <[email protected]>
--- block-qcow2.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
block-qcow2.c +1 -0
@@ -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;
Signature · 1 line
1.6.0.6
Anthony Liguori
AppliedQuoted 7 lines · Uri Lublin
From: Uri Lublin <[email protected]>
Don't leak memory
Rebased for qemu tree.
Signed-off-by Uri Lublin <[email protected]>
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
Quoted 18 lines
--- block-qcow2.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)block-qcow2.c +1
-0@@ -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;