Commit 640c4ad6 authored by Geyslan G. Bem's avatar Geyslan G. Bem Committed by Ben Hutchings

ecryptfs: Fix memory leakage in keystore.c

commit 3edc8376 upstream.

In 'decrypt_pki_encrypted_session_key' function:

Initializes 'payload' pointer and releases it on exit.
Signed-off-by: default avatarGeyslan G. Bem <geyslan@gmail.com>
Signed-off-by: default avatarTyler Hicks <tyhicks@canonical.com>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent affb0bf1
...@@ -1151,7 +1151,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, ...@@ -1151,7 +1151,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok,
struct ecryptfs_msg_ctx *msg_ctx; struct ecryptfs_msg_ctx *msg_ctx;
struct ecryptfs_message *msg = NULL; struct ecryptfs_message *msg = NULL;
char *auth_tok_sig; char *auth_tok_sig;
char *payload; char *payload = NULL;
size_t payload_len; size_t payload_len;
int rc; int rc;
...@@ -1206,6 +1206,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, ...@@ -1206,6 +1206,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok,
out: out:
if (msg) if (msg)
kfree(msg); kfree(msg);
kfree(payload);
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment