mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
testQEMUSchemaValidateObjectMergeVariantMember: Fix theoretical leak
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
d4e369a4c3
commit
962d80e751
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user