cifs: zero out session password before freeing it
authorJeff Layton <jlayton@redhat.com>
Sat, 6 Dec 2008 01:41:21 +0000 (20:41 -0500)
committerSteve French <sfrench@us.ibm.com>
Fri, 26 Dec 2008 02:29:11 +0000 (02:29 +0000)
cifs: zero out session password before freeing it

...just to be on the safe side.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/misc.c

index 9ee3f68..7c3f4b9 100644 (file)
@@ -97,7 +97,10 @@ sesInfoFree(struct cifsSesInfo *buf_to_free)
        kfree(buf_to_free->serverOS);
        kfree(buf_to_free->serverDomain);
        kfree(buf_to_free->serverNOS);
-       kfree(buf_to_free->password);
+       if (buf_to_free->password) {
+               memset(buf_to_free->password, 0, strlen(buf_to_free->password));
+               kfree(buf_to_free->password);
+       }
        kfree(buf_to_free->domainName);
        kfree(buf_to_free);
 }