From: "Daniel P. Berrange" <berrange(a)redhat.com>
If OOM or another error occurs in virJSONValueFromString the
parser state object will be leaked.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/util/virjson.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/util/virjson.c b/src/util/virjson.c
index 8918bc7..2bb7324 100644
--- a/src/util/virjson.c
+++ b/src/util/virjson.c
@@ -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);
--
1.8.3.1