mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
Fix leak of parser state in virJSONValueFromString
If OOM or another error occurs in virJSONValueFromString the parser state object will be leaked. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
d3f8fec456
commit
ec48aaee23
@ -1014,6 +1014,7 @@ cleanup:
|
|||||||
for (i = 0; i < parser.nstate; i++) {
|
for (i = 0; i < parser.nstate; i++) {
|
||||||
VIR_FREE(parser.state[i].key);
|
VIR_FREE(parser.state[i].key);
|
||||||
}
|
}
|
||||||
|
VIR_FREE(parser.state);
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG("result=%p", parser.head);
|
VIR_DEBUG("result=%p", parser.head);
|
||||||
|
Loading…
Reference in New Issue
Block a user