cifs: free blkcipher in smbhash
authorJeff Layton <jlayton@redhat.com>
Mon, 20 Jun 2011 18:33:16 +0000 (14:33 -0400)
committerSteve French <sfrench@us.ibm.com>
Fri, 24 Jun 2011 17:03:55 +0000 (17:03 +0000)
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>
fs/cifs/smbencrypt.c

index 1525d5e662b65cd11649587458013bd47dc7fc2a..1c5b770c314135a3ed932c88260470f13edd6008 100644 (file)
@@ -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;
 }