OSDN Git Service

quorum: Fix leak of opts in quorum_open
authorFam Zheng <famz@redhat.com>
Thu, 28 Aug 2014 05:56:12 +0000 (13:56 +0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 29 Aug 2014 16:10:18 +0000 (17:10 +0100)
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: BenoƮt Canet <benoit.canet@nodalink.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/quorum.c

index 0160fe3..093382e 100644 (file)
@@ -868,7 +868,7 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
 {
     BDRVQuorumState *s = bs->opaque;
     Error *local_err = NULL;
-    QemuOpts *opts;
+    QemuOpts *opts = NULL;
     bool *opened;
     QDict *sub = NULL;
     QList *list = NULL;
@@ -989,6 +989,7 @@ close_exit:
     g_free(s->bs);
     g_free(opened);
 exit:
+    qemu_opts_del(opts);
     /* propagate error */
     if (local_err) {
         error_propagate(errp, local_err);