From patchwork Wed Apr 13 16:57:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 8824251 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 34DAAC0553 for ; Wed, 13 Apr 2016 16:58:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 90AC120225 for ; Wed, 13 Apr 2016 16:58:04 +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 E00C32021F for ; Wed, 13 Apr 2016 16:58:03 +0000 (UTC) Received: from localhost ([::1]:47428 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqO79-00066b-EU for patchwork-qemu-devel@patchwork.kernel.org; Wed, 13 Apr 2016 12:58:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqO71-00064O-JW for qemu-devel@nongnu.org; Wed, 13 Apr 2016 12:57:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqO6w-0001xL-Ky for qemu-devel@nongnu.org; Wed, 13 Apr 2016 12:57:55 -0400 Received: from mail-qg0-x236.google.com ([2607:f8b0:400d:c04::236]:34608) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqO6w-0001xB-GE for qemu-devel@nongnu.org; Wed, 13 Apr 2016 12:57:50 -0400 Received: by mail-qg0-x236.google.com with SMTP id c6so48094242qga.1 for ; Wed, 13 Apr 2016 09:57:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=IhcR9HarKr2sfuh6oxiTSTkrZ+Se6IjoyOLwjZAg8bY=; b=s1U4eXWFcROhrN24g6bJnoQDF6uQYNKXjhn2FPfGLZO1tUCYeEAeEuccQSTPUMMtlh SwUstvBtQlh2E6UhHg2xTzozTeZQb6v0wucdX3+cno+Zmb4mpZVYdNaSiVD4tyFzNhiW JPGqGQA5zUPKYZRc3Ifqa0co66VO4MPE4UH8yXNfdvKvmdRGVSsZW23nMlBqQxfeLgO/ hxWjAivQMHfUdCk8gGvNbaUI9buB5aYBQQCkOClL+rutZWt9z8kxrRyc05pKErcwjDp1 4Xg1vopXstGHpvQ5vAee+A9RUcZvaD6Xs4O1bfGft7F03mdDyOKTjhAXvVG4AHmWuqQ9 TTcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=IhcR9HarKr2sfuh6oxiTSTkrZ+Se6IjoyOLwjZAg8bY=; b=GbIUfLMmB7VNpS/oNRyBpFuJWNBTcU0k+V8TuQD+9Mh2eryPEihk5rX9p3OiwgOQoF 1s1I/YeOZElFgcJhaoZy7jve46uDxz5N+yIRK1a/f4Gd6kY9UwsLuqcowYgbRFXjuP/b c3KTku4OwZ659vlQp+a8Av8RXYXckD9qnvu7paguhQOuFVxDar/lzLPTTu1iErqoKLPz GhCRML/4iZ6XvQYinki+GU4cMkN//0RQDLCNfxsNVcBFdEFWqQESuw1E/B3W/GBUbTcp okF3tZGh0FkQcMk0YLrvFk7uxUWH+kmmB0DTnEJ15nqiiwVg+eBRA7CLBz20B46KDz/S vj/w== X-Gm-Message-State: AOPr4FWUDgpgGh4DyditAO5lBMomNQVjqeP2DlNAK4gSe0YGscmut1fay2Sa//NeYqnnNg== X-Received: by 10.140.82.69 with SMTP id g63mr12565980qgd.106.1460566669855; Wed, 13 Apr 2016 09:57:49 -0700 (PDT) Received: from localhost (bne75-h02-31-39-163-232.dsl.sta.abo.bbox.fr. [31.39.163.232]) by smtp.gmail.com with ESMTPSA id n8sm16376266qki.1.2016.04.13.09.57.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Apr 2016 09:57:49 -0700 (PDT) From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Date: Wed, 13 Apr 2016 18:57:40 +0200 Message-Id: <1460566660-19241-1-git-send-email-marcandre.lureau@redhat.com> X-Mailer: git-send-email 2.5.5 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c04::236 Subject: [Qemu-devel] [PATCH] 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: pbonzini@redhat.com, =?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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Reviewed-by: Igor Mammedov --- 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), };