2
0

Copy the string into masterPassword because the line is getting free'd.

This commit is contained in:
Maarten Billemont 2014-12-04 00:28:38 -05:00
parent 8006b7096f
commit 4876d62b56

View File

@ -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;
}
}