Index: src/browser.c =================================================================== --- src/browser.c (revision 5667) +++ src/browser.c (working copy) @@ -60,6 +60,7 @@ /* The selected file we had before the current selected file. */ functionptrtype func; /* The function of the key the user typed in. */ + char *temp = NULL; /* Don't show a cursor in the file list. */ curs_set(0); @@ -322,7 +323,8 @@ /* We've successfully opened the parent directory, * save the current directory in prev_dir, so that * we can easily return to it by hitting Enter. */ - prev_dir = mallocstrcpy(NULL, striponedir(filelist[selected])); + temp = striponedir(filelist[selected]); + prev_dir = mallocstrcpy(NULL, temp); dir = opendir(filelist[selected]); if (dir == NULL) { @@ -350,6 +352,7 @@ free(path); free(ans); + free(temp); free_chararray(filelist, filelist_len); filelist = NULL;