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

[libvirt] [PATCH 12/23] Fix double-free in virJSONParserHandleStartMap on OOM



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

If OOM occurs in virJSONParserHandleStartMap it will free
a variable that is owned by another object. This leads to
a later double-free.

Signed-off-by: Daniel P. Berrange <berrange redhat com>
---
 src/util/virjson.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/util/virjson.c b/src/util/virjson.c
index e93def7..8918bc7 100644
--- a/src/util/virjson.c
+++ b/src/util/virjson.c
@@ -862,7 +862,6 @@ static int virJSONParserHandleStartMap(void *ctx)
 
     if (VIR_REALLOC_N(parser->state,
                       parser->nstate + 1) < 0) {
-        virJSONValueFree(value);
         return 0;
     }
 
-- 
1.8.3.1


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