]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix double-free in virJSONParserHandleStartMap on OOM
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 25 Sep 2013 14:16:24 +0000 (15:16 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 25 Sep 2013 17:12:09 +0000 (18:12 +0100)
If OOM occurs in virJSONParserHandleStartMap it will free
a variable that is owned by another object. This leads to
a later double-free.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/util/virjson.c

index e93def7cfaf47e35f6022f68eca13aaf25db6ccc..8918bc7f0c2e55628543d802737984ebab81cd8d 100644 (file)
@@ -862,7 +862,6 @@ static int virJSONParserHandleStartMap(void *ctx)
 
     if (VIR_REALLOC_N(parser->state,
                       parser->nstate + 1) < 0) {
-        virJSONValueFree(value);
         return 0;
     }