From patchwork Fri Apr 15 16:33:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 8852221 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5B6D8BF29F for ; Fri, 15 Apr 2016 16:33:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C35BE20380 for ; Fri, 15 Apr 2016 16:33:47 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1E13520274 for ; Fri, 15 Apr 2016 16:33:47 +0000 (UTC) Received: from localhost ([::1]:37376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ar6gj-00032R-99 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 15 Apr 2016 12:33:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56431) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ar6gX-0002yg-DB for qemu-devel@nongnu.org; Fri, 15 Apr 2016 12:33:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ar6gU-0003h2-JN for qemu-devel@nongnu.org; Fri, 15 Apr 2016 12:33:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ar6gU-0003fw-EL for qemu-devel@nongnu.org; Fri, 15 Apr 2016 12:33:30 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 93CC68E3EE for ; Fri, 15 Apr 2016 16:33:28 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-25.ams2.redhat.com [10.36.116.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3FGXQbl023627 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 15 Apr 2016 12:33:28 -0400 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 45E3E11386D6; Fri, 15 Apr 2016 18:33:26 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Fri, 15 Apr 2016 18:33:26 +0200 Message-Id: <1460738006-23713-2-git-send-email-armbru@redhat.com> In-Reply-To: <1460738006-23713-1-git-send-email-armbru@redhat.com> References: <1460738006-23713-1-git-send-email-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/1] hostmem-file: plug a small leak X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Marc-André Lureau Signed-off-by: Marc-André Lureau Message-Id: <1460566660-19241-1-git-send-email-marcandre.lureau@redhat.com> Reviewed-by: Igor Mammedov Signed-off-by: Markus Armbruster --- backends/hostmem-file.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index b17a1f1..5c4b808 100644 --- a/backends/hostmem-file.c +++ b/backends/hostmem-file.c @@ -121,11 +121,19 @@ file_backend_instance_init(Object *o) set_mem_path, NULL); } +static void file_backend_instance_finalize(Object *o) +{ + HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(o); + + g_free(fb->mem_path); +} + static const TypeInfo file_backend_info = { .name = TYPE_MEMORY_BACKEND_FILE, .parent = TYPE_MEMORY_BACKEND, .class_init = file_backend_class_init, .instance_init = file_backend_instance_init, + .instance_finalize = file_backend_instance_finalize, .instance_size = sizeof(HostMemoryBackendFile), };