From: David Howells Subject: [PATCH 23/27] NFS: Fix memory leak Date: Wed, 23 Jan 2008 00:45:47 +0000 Message-ID: <20080123004547.15602.89596.stgit@warthog.procyon.org.uk> References: <20080123004344.15602.35710.stgit@warthog.procyon.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: nfsv4@linux-nfs.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, selinux@tycho.nsa.gov, linux-security-module@vger.kernel.org, dhowells@redhat.com To: Trond.Myklebust@netapp.com Return-path: Received: from mx1.redhat.com ([66.187.233.31]:34491 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755528AbYAWApv (ORCPT ); Tue, 22 Jan 2008 19:45:51 -0500 In-Reply-To: <20080123004344.15602.35710.stgit@warthog.procyon.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Fix a memory leak whereby multiple clientaddr=xxx mount options just overwrite the duplicated client_address option pointer, without freeing the old memory. Signed-off-by: David Howells --- fs/nfs/super.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 0b0c72a..7f5e747 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -936,6 +936,7 @@ static int nfs_parse_mount_options(char *raw, string = match_strdup(args); if (string == NULL) goto out_nomem; + kfree(mnt->client_address); mnt->client_address = string; break; case Opt_mountaddr: