From: Daniel P. Berrange Date: Wed, 25 Sep 2013 14:16:24 +0000 (+0100) Subject: Fix double-free in virJSONParserHandleStartMap on OOM X-Git-Tag: v1.1.3-rc1~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3f8fec456c814ad01eb05f471988e0604e03fed;p=thirdparty%2Flibvirt.git Fix double-free in virJSONParserHandleStartMap on OOM 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 --- diff --git a/src/util/virjson.c b/src/util/virjson.c index e93def7cfa..8918bc7f0c 100644 --- a/src/util/virjson.c +++ b/src/util/virjson.c @@ -862,7 +862,6 @@ static int virJSONParserHandleStartMap(void *ctx) if (VIR_REALLOC_N(parser->state, parser->nstate + 1) < 0) { - virJSONValueFree(value); return 0; }