[PATCH 19/25] testQEMUSchemaValidateObjectMergeVariantMember: Fix theoretical leak

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

 



Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 tests/testutilsqemuschema.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/testutilsqemuschema.c b/tests/testutilsqemuschema.c
index 101687e657..4bb303a427 100644
--- a/tests/testutilsqemuschema.c
+++ b/tests/testutilsqemuschema.c
@@ -163,13 +163,14 @@ testQEMUSchemaValidateObjectMergeVariantMember(size_t pos G_GNUC_UNUSED,
                                                void *opaque)
 {
     virJSONValuePtr array = opaque;
-    virJSONValuePtr copy;
+    g_autoptr(virJSONValue) copy = NULL;

     if (!(copy = virJSONValueCopy(item)))
         return -1;

     if (virJSONValueArrayAppend(array, copy) < 0)
         return -1;
+    copy = NULL;

     return 1;
 }
-- 
2.29.2




[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]

  Powered by Linux