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 <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2013-09-25 15:16:24 +01:00
parent 6bf3078657
commit d3f8fec456

View File

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