summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeyslan G. Bem <geyslan@gmail.com>2013-10-11 16:49:16 -0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-11-13 12:05:31 +0900
commit4053771449476d9c323bd00c0c87bbd390588e55 (patch)
tree3286e153d33a5e2b3ea2c14af0423bda3eaa4c25
parentda0d4136d107d926273c227fdeaf805159044f66 (diff)
downloadlinux-3.10-4053771449476d9c323bd00c0c87bbd390588e55.tar.gz
linux-3.10-4053771449476d9c323bd00c0c87bbd390588e55.tar.bz2
linux-3.10-4053771449476d9c323bd00c0c87bbd390588e55.zip
ecryptfs: Fix memory leakage in keystore.c
commit 3edc8376c06133e3386265a824869cad03a4efd4 upstream. In 'decrypt_pki_encrypted_session_key' function: Initializes 'payload' pointer and releases it on exit. Signed-off-by: Geyslan G. Bem <geyslan@gmail.com> Signed-off-by: Tyler Hicks <tyhicks@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/ecryptfs/keystore.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c
index 7d52806c211..4725a07f003 100644
--- a/fs/ecryptfs/keystore.c
+++ b/fs/ecryptfs/keystore.c
@@ -1149,7 +1149,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok,
struct ecryptfs_msg_ctx *msg_ctx;
struct ecryptfs_message *msg = NULL;
char *auth_tok_sig;
- char *payload;
+ char *payload = NULL;
size_t payload_len = 0;
int rc;
@@ -1203,6 +1203,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok,
}
out:
kfree(msg);
+ kfree(payload);
return rc;
}