提交 5c878008 编写于 作者: S Stefan Weil

qdev: Fix memory leak in function set_pci_devfn

Valgrind reported this memory leak which occured very often.

Test scenario:

qemu-system-i386 (no arguments), only BIOS started, terminate with
monitor command (quit).

v2:
Use error_free instead of g_free (hint from Andreas Färber, thanks).
Signed-off-by: NStefan Weil <sw@weilnetz.de>
Acked-by: NAndreas Färber <afaerber@suse.de>
上级 3881725c
...@@ -834,6 +834,7 @@ static void set_pci_devfn(Object *obj, Visitor *v, void *opaque, ...@@ -834,6 +834,7 @@ static void set_pci_devfn(Object *obj, Visitor *v, void *opaque,
visit_type_str(v, &str, name, &local_err); visit_type_str(v, &str, name, &local_err);
if (local_err) { if (local_err) {
error_free(local_err);
return set_int32(obj, v, opaque, name, errp); return set_int32(obj, v, opaque, name, errp);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册