aboutsummaryrefslogtreecommitdiff
path: root/fs/cifs
diff options
context:
space:
mode:
authorAlexander Strakh <strakh@ispras.ru>2009-09-01 17:02:24 +0000
committerSteve French <sfrench@us.ibm.com>2009-09-01 17:02:24 +0000
commit1b3859bc9e20d764316346665fc93ecea2d2b176 (patch)
tree9a643e0bf74d9b8339ae4bc45df1988ed306dc4d /fs/cifs
parent2920ee2b47fc8e6aebe1d1956b2725f48fa93cc5 (diff)
[CIFS] Memory leak in ntlmv2 hash calculation
in function calc_ntlmv2_hash memory is not released. 1. If in the line 333 we successfully allocate memory and assign it to pctxt variable: pctxt = kmalloc(sizeof(struct HMACMD5Context), GFP_KERNEL); then we go to line 376 and exit wihout releasing memory pointed to by pctxt variable. Add a memory releasing for pctxt variable before exit from function calc_ntlmv2_hash. Signed-off-by: Alexander Strakh <strakh@ispras.ru> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/cifsencrypt.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c
index 7c9809523f4..7efe1745494 100644
--- a/fs/cifs/cifsencrypt.c
+++ b/fs/cifs/cifsencrypt.c
@@ -373,6 +373,7 @@ calc_exit_2:
compare with the NTLM example */
hmac_md5_final(ses->server->ntlmv2_hash, pctxt);
+ kfree(pctxt);
return rc;
}