From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c5TRz-0003B8-Iy for qemu-devel@nongnu.org; Sat, 12 Nov 2016 03:14:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c5TRu-00050N-LO for qemu-devel@nongnu.org; Sat, 12 Nov 2016 03:14:11 -0500 Received: from mail-it0-x243.google.com ([2607:f8b0:4001:c0b::243]:34439) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c5TRu-00050J-GG for qemu-devel@nongnu.org; Sat, 12 Nov 2016 03:14:06 -0500 Received: by mail-it0-x243.google.com with SMTP id q124so1999794itd.1 for ; Sat, 12 Nov 2016 00:14:06 -0800 (PST) Message-ID: <5826cf4d.4b866b0a.caff8.66a8@mx.google.com> From: Li Qiang Date: Sat, 12 Nov 2016 00:13:56 -0800 Subject: [Qemu-devel] [PATCH] 9pfs: free the private data memory in device unrealize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: groug@kaod.org, qemu-devel@nongnu.org Cc: Li Qiang From: Li Qiang When the 9pfs use 'handle'/'proxy' as the backend driver it will allocate a private data memory. But this memory is not freed in the unrealize function thus leading a memory leak issue. This patch avoid this. Signed-off-by: Li Qiang --- hw/9pfs/9p.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index aea7e9d..6524b13 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -3532,6 +3532,7 @@ void v9fs_device_unrealize_common(V9fsState *s, Error **errp) { g_free(s->ctx.fs_root); g_free(s->tag); + g_free(s->ctx.private); } typedef struct VirtfsCoResetData { -- 1.8.3.1