EcryptFS development
 help / color / mirror / Atom feed
* [PATCH] ecryptfs: Fix memory leakage in keystore.c
@ 2013-10-11 19:49 Geyslan G. Bem
  2013-10-17  1:11 ` Tyler Hicks
  0 siblings, 1 reply; 3+ messages in thread
From: Geyslan G. Bem @ 2013-10-11 19:49 UTC (permalink / raw)
  To: tyhicks; +Cc: ecryptfs, linux-kernel, joe, kernel-br, Geyslan G. Bem

In 'decrypt_pki_encrypted_session_key' function:

Initializes 'payload' pointer and releases it on exit.

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
---
 fs/ecryptfs/keystore.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c
index 7d52806..4725a07 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,
 	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;
 
@@ -1203,6 +1203,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok,
 	}
 out:
 	kfree(msg);
+	kfree(payload);
 	return rc;
 }
 
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-17  1:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-11 19:49 [PATCH] ecryptfs: Fix memory leakage in keystore.c Geyslan G. Bem
2013-10-17  1:11 ` Tyler Hicks
2013-10-17  1:21   ` Geyslan Gregório Bem

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox