From 5c878008ddc1fbdb688dee7cdca93e1fd55845dc Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sat, 28 Apr 2012 02:32:42 +0000 Subject: [PATCH] qdev: Fix memory leak in function set_pci_devfn MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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: Stefan Weil Acked-by: Andreas Färber --- hw/qdev-properties.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c index 98dd06aeba..c5545dcd37 100644 --- a/hw/qdev-properties.c +++ b/hw/qdev-properties.c @@ -834,6 +834,7 @@ static void set_pci_devfn(Object *obj, Visitor *v, void *opaque, visit_type_str(v, &str, name, &local_err); if (local_err) { + error_free(local_err); return set_int32(obj, v, opaque, name, errp); } -- 2.34.1