util: Fix memory leak in virJSONParserHandleStartMap

This commit is contained in:
Osier Yang 2011-06-23 18:16:31 +08:00
parent d61820df98
commit 91141474f8

View File

@ -799,8 +799,10 @@ static int virJSONParserHandleStartMap(void *ctx)
}
if (VIR_REALLOC_N(parser->state,
parser->nstate + 1) < 0)
parser->nstate + 1) < 0) {
virJSONValueFree(value);
return 0;
}
parser->state[parser->nstate].value = value;
parser->state[parser->nstate].key = NULL;