From: Geyslan G. Bem Date: Fri, 11 Oct 2013 19:49:16 +0000 (-0300) Subject: ecryptfs: Fix memory leakage in keystore.c X-Git-Tag: v3.2.53~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=640c4ad6d759b60a64049ff46c9acff5954f18d6;p=people%2Fms%2Flinux.git 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 Signed-off-by: Tyler Hicks [bwh: Backported to 3.2: adjust context] Signed-off-by: Ben Hutchings --- 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; }