Received: from eggs.gnu.org ([208.118.235.92]:55378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1yRz-0001iH-Sg for qemu-devel@nongnu.org; Thu, 16 Aug 2012 07:41:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1yRy-000631-35 for qemu-devel@nongnu.org; Thu, 16 Aug 2012 07:41:19 -0400 Received: from oxygen.pond.sub.org ([78.46.104.156]:37197) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1yRx-00062h-S5 for qemu-devel@nongnu.org; Thu, 16 Aug 2012 07:41:17 -0400 From: Markus Armbruster Date: Thu, 16 Aug 2012 13:41:13 +0200 Message-Id: <1345117273-19526-3-git-send-email-armbru@redhat.com> In-Reply-To: <1345117273-19526-1-git-send-email-armbru@redhat.com> References: <1345117273-19526-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] pc_sysfw: Plug memory leak on pc_fw_add_pflash_drv() error path List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: jordan.l.justen@intel.com, anthony@codemonkey.ws Harmless, because we the error inevitably leads to another, fatal one in pc_system_flash_init(): PC system firmware (pflash) not available. Fix it anyway. Signed-off-by: Markus Armbruster --- hw/pc_sysfw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/pc_sysfw.c b/hw/pc_sysfw.c index fd22154..ebb6b25 100644 --- a/hw/pc_sysfw.c +++ b/hw/pc_sysfw.c @@ -103,7 +103,9 @@ static void pc_fw_add_pflash_drv(void) return; } - drive_init(opts, machine->use_scsi); + if (!drive_init(opts, machine->use_scsi)) { + qemu_opts_del(opts); + } } static void pc_system_flash_init(MemoryRegion *rom_memory, -- 1.7.11.2