diff options
author | Geyslan G. Bem <geyslan@gmail.com> | 2013-10-11 16:49:16 -0300 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2013-11-28 14:02:04 +0000 |
commit | 640c4ad6d759b60a64049ff46c9acff5954f18d6 (patch) | |
tree | 227ff8293c5f595b240f46fe97587d6d68f27e02 /fs/ecryptfs | |
parent | affb0bf19afa81cf004c67e357a33a9693e9ff3e (diff) | |
download | lwn-640c4ad6d759b60a64049ff46c9acff5954f18d6.tar.gz lwn-640c4ad6d759b60a64049ff46c9acff5954f18d6.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>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'fs/ecryptfs')
-rw-r--r-- | fs/ecryptfs/keystore.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c index ac1ad48c2376..5ce56e7598b1 100644 --- a/fs/ecryptfs/keystore.c +++ b/fs/ecryptfs/keystore.c @@ -1151,7 +1151,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; int rc; @@ -1206,6 +1206,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, out: if (msg) kfree(msg); + kfree(payload); return rc; } |