From: Peter Krempa Date: Fri, 12 Feb 2021 10:36:30 +0000 (+0100) Subject: testQEMUSchemaValidateObjectMergeVariantMember: Fix theoretical leak X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=962d80e75107858c239472616c9ea5cfccd6e87c;p=libvirt.git testQEMUSchemaValidateObjectMergeVariantMember: Fix theoretical leak Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- 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; }