Skip to content

Commit

Permalink
cifs: free blkcipher in smbhash
Browse files Browse the repository at this point in the history
This is currently leaked in the rc == 0 case.

Reported-by: J. Bruce Fields <bfields@fieldses.org>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
  • Loading branch information
jtlayton authored and Steve French committed Jun 24, 2011
1 parent 5220cc9 commit e4fb0ed
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/cifs/smbencrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,10 @@ smbhash(unsigned char *out, const unsigned char *in, unsigned char *key)
sg_init_one(&sgout, out, 8);

rc = crypto_blkcipher_encrypt(&desc, &sgout, &sgin, 8);
if (rc) {
if (rc)
cERROR(1, "could not encrypt crypt key rc: %d\n", rc);
crypto_free_blkcipher(tfm_des);
goto smbhash_err;
}

crypto_free_blkcipher(tfm_des);
smbhash_err:
return rc;
}
Expand Down

0 comments on commit e4fb0ed

Please sign in to comment.