tttm

git clone https://orangeshoelaces.net/git/tttm.git

a03bb9e9feaa578d86835d4ab43732ccab3c84e6

Author: Vasily Kolobkov on 06/03/2016

Committer: Vasily Kolobkov on 06/03/2016

Wipe credentials off of environment after use

Stats

tttm.c | 5 +++++
1 file changed, 5 insertions(+)

Patch

diff --git a/tttm.c b/tttm.c
index 402be3d..3e4029a 100644
--- a/tttm.c
+++ b/tttm.c
@@ -87,6 +87,11 @@ main(int argc, char **argv)
 	}
 
  select:
+	if (unsetenv(userkey) == -1 || unsetenv(passkey) == -1) {
+		warn("failed to wipe credentials off of environment");
+		goto logout;
+	}
+
 	if ((e = imap_select(&con, "inbox"))) {
 		fin(&con, e, "failed to select mailbox");
 	}