[libvirt] [PATCH 05/10] util: Need to check child JSON allocation before use

John Ferlan jferlan at redhat.com
Thu Jan 17 19:17:10 UTC 2013


---
 src/util/virlockspace.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/util/virlockspace.c b/src/util/virlockspace.c
index 163404f..fd89598 100644
--- a/src/util/virlockspace.c
+++ b/src/util/virlockspace.c
@@ -483,6 +483,9 @@ virJSONValuePtr virLockSpacePreExecRestart(virLockSpacePtr lockspace)
         virJSONValuePtr owners = NULL;
         size_t i;
 
+        if (!child)
+            goto error;
+
         if (virJSONValueArrayAppend(resources, child) < 0) {
             virJSONValueFree(child);
             goto error;
-- 
1.7.11.7




More information about the libvir-list mailing list