[CIFS] Memory leak in ntlmv2 hash calculation
authorAlexander Strakh <strakh@ispras.ru>
Tue, 1 Sep 2009 17:02:24 +0000 (17:02 +0000)
committerSteve French <sfrench@us.ibm.com>
Tue, 1 Sep 2009 17:02:24 +0000 (17:02 +0000)
 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>
fs/cifs/cifsencrypt.c

index 7c9809523f428a1cf3a31128d32d0d101152e2f6..7efe1745494d10a4968ef09f308af577d6ccc1c9 100644 (file)
@@ -373,6 +373,7 @@ calc_exit_2:
           compare with the NTLM example */
        hmac_md5_final(ses->server->ntlmv2_hash, pctxt);
 
+       kfree(pctxt);
        return rc;
 }
 
This page took 0.025479 seconds and 5 git commands to generate.