提交 903c341d 编写于 作者: M Markus Armbruster 提交者: Kevin Wolf

block/qapi: Plug memory leak on query-block error path

Spotted by Coverity.
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Reviewed-by: NKevin Wolf <kwolf@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 98caa5bc
......@@ -436,7 +436,9 @@ BlockInfoList *qmp_query_block(Error **errp)
bdrv_query_info(blk, &info->value, &local_err);
if (local_err) {
error_propagate(errp, local_err);
goto err;
g_free(info);
qapi_free_BlockInfoList(head);
return NULL;
}
*p_next = info;
......@@ -444,10 +446,6 @@ BlockInfoList *qmp_query_block(Error **errp)
}
return head;
err:
qapi_free_BlockInfoList(head);
return NULL;
}
BlockStatsList *qmp_query_blockstats(bool has_query_nodes,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册