diff options
author | Geyslan G. Bem <geyslan@gmail.com> | 2013-10-11 15:49:16 -0400 |
---|---|---|
committer | Tyler Hicks <tyhicks@canonical.com> | 2013-10-16 18:18:01 -0400 |
commit | 3edc8376c06133e3386265a824869cad03a4efd4 (patch) | |
tree | 285056122ff468ba24472764e76ef8633874e6d2 | |
parent | d6099aeb4a9aad5e7ab1c72eb119ebd52dee0d52 (diff) |
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+
-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 7d52806c2119..4725a07f003c 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, | |||
1149 | struct ecryptfs_msg_ctx *msg_ctx; | 1149 | struct ecryptfs_msg_ctx *msg_ctx; |
1150 | struct ecryptfs_message *msg = NULL; | 1150 | struct ecryptfs_message *msg = NULL; |
1151 | char *auth_tok_sig; | 1151 | char *auth_tok_sig; |
1152 | char *payload; | 1152 | char *payload = NULL; |
1153 | size_t payload_len = 0; | 1153 | size_t payload_len = 0; |
1154 | int rc; | 1154 | int rc; |
1155 | 1155 | ||
@@ -1203,6 +1203,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, | |||
1203 | } | 1203 | } |
1204 | out: | 1204 | out: |
1205 | kfree(msg); | 1205 | kfree(msg); |
1206 | kfree(payload); | ||
1206 | return rc; | 1207 | return rc; |
1207 | } | 1208 | } |
1208 | 1209 | ||