Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
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