Received: from eggs.gnu.org ([2001:4830:134:3::10]:40693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bX3A1-0005bK-UY for qemu-devel@nongnu.org; Tue, 09 Aug 2016 05:17:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bX3A0-0000Fz-TX for qemu-devel@nongnu.org; Tue, 09 Aug 2016 05:17:21 -0400 From: Thomas Huth Date: Tue, 9 Aug 2016 11:17:07 +0200 Message-Id: <1470734229-10832-4-git-send-email-thuth@redhat.com> In-Reply-To: <1470734229-10832-1-git-send-email-thuth@redhat.com> References: <1470734229-10832-1-git-send-email-thuth@redhat.com> Subject: [Qemu-devel] [PATCH 3/5] hw/ppc/spapr: Do not leak the memory of the type string List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson , qemu-ppc@nongnu.org Cc: Alexander Graf , qemu-devel@nongnu.org, abologna@redhat.com, bharata@linux.vnet.ibm.com The type string is allocated in spapr_get_cpu_core_type() with g_strdup_printf(), so we should free this memory when we're done with it. Signed-off-by: Thomas Huth --- hw/ppc/spapr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index ec65b07..424b506 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1840,6 +1840,7 @@ static void ppc_spapr_init(MachineState *machine) object_property_set_int(core, core_id, CPU_CORE_PROP_CORE_ID, &error_fatal); object_property_set_bool(core, true, "realized", &error_fatal); + g_free(type); } } g_free(type); -- 1.8.3.1