From c3c2de5d14013c0a51c91fc71c52048d01c532f1 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Wed, 15 Oct 2014 15:37:29 -0400 Subject: [PATCH] Ensure master password isn't lost after ending editline context. --- MasterPassword/C/mpw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MasterPassword/C/mpw.c b/MasterPassword/C/mpw.c index 51e5a312..df723a74 100644 --- a/MasterPassword/C/mpw.c +++ b/MasterPassword/C/mpw.c @@ -197,7 +197,7 @@ int main(int argc, char *const argv[]) { EditLine *e = el_init("mpw", stdin, stdout, stderr); int count = 0; char *line = el_gets(e, &count); - masterPassword = strsep(&line, "\n"); + masterPassword = strdup(strsep(&line, "\n")); el_end(e); if (count < 0) {