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

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

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

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

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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]