[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 13/23] Fix leak of parser state in virJSONValueFromString



From: "Daniel P. Berrange" <berrange redhat com>

If OOM or another error occurs in virJSONValueFromString the
parser state object will be leaked.

Signed-off-by: Daniel P. Berrange <berrange 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]