提交 fe434a0c 编写于 作者: P Peter Krempa

util: storagefile: Simplify cleanup in virStorageSourceParseBackingJSON

Automatically free the 'root' temporary variable to get rid of some
complexity.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 e8578b24
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册