Patchwork block: Release allocated options after bdrv_open

login
register
mail settings
Submitter Jan Kiszka
Date April 29, 2010, 4:24 p.m.
Message ID <4BD9B2D2.9040208@siemens.com>
Download mbox | patch
Permalink /patch/51301/
State New
Headers show

Comments

Jan Kiszka - April 29, 2010, 4:24 p.m.
They aren't used afterwards nor supposed to be stored by a bdrv_create
handler.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 block.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Kevin Wolf - April 30, 2010, 7:58 a.m.
Am 29.04.2010 18:24, schrieb Jan Kiszka:
> They aren't used afterwards nor supposed to be stored by a bdrv_create
> handler.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

Thanks, applied to the block branch.

Kevin

Patch

diff --git a/block.c b/block.c
index 7974215..f228d8d 100644
--- a/block.c
+++ b/block.c
@@ -411,6 +411,7 @@  int bdrv_open(BlockDriverState *bs, const char *filename, int flags,
         }
 
         ret = bdrv_create(bdrv_qcow2, tmp_filename, options);
+        free_option_parameters(options);
         if (ret < 0) {
             return ret;
         }