mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-14 05:57:26 +03:00
util: storagefile: Simplify cleanup in virStorageSourceParseBackingJSON
Automatically free the 'root' temporary variable to get rid of some complexity. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
e8578b245b
commit
fe434a0ceb
@ -3624,16 +3624,12 @@ static int
|
||||
virStorageSourceParseBackingJSON(virStorageSourcePtr src,
|
||||
const char *json)
|
||||
{
|
||||
virJSONValuePtr root = NULL;
|
||||
int ret = -1;
|
||||
VIR_AUTOPTR(virJSONValue) root = NULL;
|
||||
|
||||
if (!(root = virJSONValueFromString(json)))
|
||||
return -1;
|
||||
|
||||
ret = virStorageSourceParseBackingJSONInternal(src, root);
|
||||
|
||||
virJSONValueFree(root);
|
||||
return ret;
|
||||
return virStorageSourceParseBackingJSONInternal(src, root);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user