Skip to content

Commit

Permalink
ecryptfs: Fix memory leakage in keystore.c
Browse files Browse the repository at this point in the history
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+
  • Loading branch information
Geyslan G. Bem authored and Tyler Hicks committed Oct 16, 2013
1 parent d6099ae commit 3edc837
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/ecryptfs/keystore.c
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,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 = 0;
int rc;

Expand Down Expand Up @@ -1203,6 +1203,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok,
}
out:
kfree(msg);
kfree(payload);
return rc;
}

Expand Down

0 comments on commit 3edc837

Please sign in to comment.