mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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)
|
void *opaque)
|
||||||
{
|
{
|
||||||
virJSONValuePtr array = opaque;
|
virJSONValuePtr array = opaque;
|
||||||
virJSONValuePtr copy;
|
g_autoptr(virJSONValue) copy = NULL;
|
||||||
|
|
||||||
if (!(copy = virJSONValueCopy(item)))
|
if (!(copy = virJSONValueCopy(item)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (virJSONValueArrayAppend(array, copy) < 0)
|
if (virJSONValueArrayAppend(array, copy) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
copy = NULL;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user