mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH]  CIFS: memory leakage at ./fs/cifs/cifsencrypt.c
@ 2009-08-11 19:28 iceberg
  0 siblings, 0 replies; only message in thread
From: iceberg @ 2009-08-11 19:28 UTC (permalink / raw)
  To: linux-kernel

 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>

---
diff --git a/a/fs/cifs/cifsencrypt.c b/b/fs/cifs/cifsencrypt.c
index 7c98095..7efe174 100644
--- a/a/fs/cifs/cifsencrypt.c
+++ b/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;
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-08-11 15:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-11 19:28 [PATCH] CIFS: memory leakage at ./fs/cifs/cifsencrypt.c iceberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®