Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ecryptfs: Fix memory leakage in keystore.c

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>
Cc: stable@vger.kernel.org # v2.6.28+

authored by

Geyslan G. Bem and committed by
Tyler Hicks
3edc8376 d6099aeb

+2 -1
+2 -1
fs/ecryptfs/keystore.c
··· 1149 1149 struct ecryptfs_msg_ctx *msg_ctx; 1150 1150 struct ecryptfs_message *msg = NULL; 1151 1151 char *auth_tok_sig; 1152 - char *payload; 1152 + char *payload = NULL; 1153 1153 size_t payload_len = 0; 1154 1154 int rc; 1155 1155 ··· 1203 1203 } 1204 1204 out: 1205 1205 kfree(msg); 1206 + kfree(payload); 1206 1207 return rc; 1207 1208 } 1208 1209