diff --git a/MasterPassword/C/mpw.c b/MasterPassword/C/mpw.c index 3eff6f1e..4963f27a 100644 --- a/MasterPassword/C/mpw.c +++ b/MasterPassword/C/mpw.c @@ -203,7 +203,7 @@ int main(int argc, char *const argv[]) { while ((linelen = getline(&line, &linecap, mpwConfig)) > 0) { char *lineData = line; if (strcmp(strsep(&lineData, ":"), userName) == 0) { - masterPassword = strsep(&lineData, "\n"); + masterPassword = strcpy(malloc(strlen(lineData)), strsep(&lineData, "\n")); break; } }