mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
virJSONValueObjectAddVArgs: Use autofree for the temporary bitmap
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
94ab321ffc
commit
e4b26c48cb
@ -305,7 +305,7 @@ virJSONValueObjectAddVArgs(virJSONValuePtr obj,
|
||||
case 'M':
|
||||
case 'm': {
|
||||
virBitmapPtr map = va_arg(args, virBitmapPtr);
|
||||
virJSONValuePtr jsonMap;
|
||||
g_autoptr(virJSONValue) jsonMap = NULL;
|
||||
|
||||
if (!map) {
|
||||
if (type == 'M')
|
||||
@ -321,7 +321,8 @@ virJSONValueObjectAddVArgs(virJSONValuePtr obj,
|
||||
return -1;
|
||||
|
||||
if ((rc = virJSONValueObjectAppend(obj, key, jsonMap)) < 0)
|
||||
virJSONValueFree(jsonMap);
|
||||
return -1;
|
||||
jsonMap = NULL;
|
||||
} break;
|
||||
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user