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:
Daniel P. Berrange 2013-09-25 15:17:04 +01:00
parent d3f8fec456
commit ec48aaee23

View File

@ -1014,6 +1014,7 @@ cleanup:
for (i = 0; i < parser.nstate; i++) {
VIR_FREE(parser.state[i].key);
}
VIR_FREE(parser.state);
}
VIR_DEBUG("result=%p", parser.head);