[PATCH 23/27] NFS: Fix memory leak [try #2]

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <Trond.Myklebust@...>
Cc: <nfsv4@...>, <linux-kernel@...>, <linux-fsdevel@...>, <selinux@...>, <linux-security-module@...>, <dhowells@...>
Date: Wednesday, January 23, 2008 - 1:22 pm

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 <dhowells@redhat.com>
---

 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:

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/27] Permit filesystem local caching [try #2], David Howells, (Wed Jan 23, 1:20 pm)
[PATCH 24/27] NFS: Use local caching [try #2], David Howells, (Wed Jan 23, 1:22 pm)
Re: [PATCH 24/27] NFS: Use local caching [try #2], Chuck Lever, (Thu Jan 24, 5:22 pm)
Re: [PATCH 24/27] NFS: Use local caching [try #2], David Howells, (Thu Feb 7, 6:57 am)
Re: [PATCH 24/27] NFS: Use local caching [try #2], David Howells, (Tue Jan 29, 11:25 pm)
Re: [PATCH 24/27] NFS: Use local caching [try #2], Chuck Lever, (Wed Jan 30, 6:36 pm)
Re: [PATCH 24/27] NFS: Use local caching [try #2], David Howells, (Thu Jan 31, 7:29 pm)
Re: [PATCH 24/27] NFS: Use local caching [try #2], Trond Myklebust, (Wed Jan 30, 2:46 am)
Re: [PATCH 24/27] NFS: Use local caching [try #2], Trond Myklebust, (Thu Jan 24, 5:08 pm)
[PATCH 26/27] NFS: Display local caching state [try #2], David Howells, (Wed Jan 23, 1:22 pm)
[PATCH 23/27] NFS: Fix memory leak [try #2], David Howells, (Wed Jan 23, 1:22 pm)
Re: [PATCH 23/27] NFS: Fix memory leak [try #2], Trond Myklebust, (Thu Jan 24, 5:15 pm)