mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
util: Fix memory leak in virJSONParserHandleStartMap
This commit is contained in:
parent
d61820df98
commit
91141474f8
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user