2008-10-20 06:17:13

by Krishna Kumar2

[permalink] [raw]
Subject: [PATCH 3/4] nfsd: Fix leaked memory in nfs4_make_rec_clidname

From: Krishna Kumar <[email protected]>

cksum.data is not freed up in one error case. Compile tested.

Signed-off-by: Krishna Kumar <[email protected]>
---

fs/nfsd/nfs4recover.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff -ruNp linux-2.6.27.org/fs/nfsd/nfs4recover.c linux-2.6.27.new/fs/nfsd/nfs4recover.c
--- linux-2.6.27.org/fs/nfsd/nfs4recover.c 2008-10-20 10:47:15.000000000 +0530
+++ linux-2.6.27.new/fs/nfsd/nfs4recover.c 2008-10-20 10:48:38.000000000 +0530
@@ -110,9 +110,9 @@ nfs4_make_rec_clidname(char *dname, stru

md5_to_hex(dname, cksum.data);

- kfree(cksum.data);
status = nfs_ok;
out:
+ kfree(cksum.data);
crypto_free_hash(desc.tfm);
out_no_tfm:
return status;


2008-10-20 20:58:45

by J. Bruce Fields

[permalink] [raw]
Subject: Re: [PATCH 3/4] nfsd: Fix leaked memory in nfs4_make_rec_clidname

On Mon, Oct 20, 2008 at 11:47:09AM +0530, Krishna Kumar wrote:
> From: Krishna Kumar <[email protected]>
>
> cksum.data is not freed up in one error case. Compile tested.
>

Thanks, applied.

--b.

> Signed-off-by: Krishna Kumar <[email protected]>
> ---
>
> fs/nfsd/nfs4recover.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff -ruNp linux-2.6.27.org/fs/nfsd/nfs4recover.c linux-2.6.27.new/fs/nfsd/nfs4recover.c
> --- linux-2.6.27.org/fs/nfsd/nfs4recover.c 2008-10-20 10:47:15.000000000 +0530
> +++ linux-2.6.27.new/fs/nfsd/nfs4recover.c 2008-10-20 10:48:38.000000000 +0530
> @@ -110,9 +110,9 @@ nfs4_make_rec_clidname(char *dname, stru
>
> md5_to_hex(dname, cksum.data);
>
> - kfree(cksum.data);
> status = nfs_ok;
> out:
> + kfree(cksum.data);
> crypto_free_hash(desc.tfm);
> out_no_tfm:
> return status;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html