browser: fix a memory leak
Этот коммит содержится в:
родитель
9576eb62e6
Коммит
2e75c22759
@ -380,12 +380,13 @@ char *do_browse_from(const char *inpath)
|
|||||||
path = mallocstrassn(path, striponedir(path));
|
path = mallocstrassn(path, striponedir(path));
|
||||||
|
|
||||||
if (stat(path, &st) == -1 || !S_ISDIR(st.st_mode)) {
|
if (stat(path, &st) == -1 || !S_ISDIR(st.st_mode)) {
|
||||||
free(path);
|
char * currentdir = charalloc(PATH_MAX + 1);
|
||||||
|
|
||||||
path = charalloc(PATH_MAX + 1);
|
free(path);
|
||||||
path = getcwd(path, PATH_MAX + 1);
|
path = getcwd(currentdir, PATH_MAX + 1);
|
||||||
|
|
||||||
if (path == NULL) {
|
if (path == NULL) {
|
||||||
|
free(currentdir);
|
||||||
statusline(MILD, "The working directory has disappeared");
|
statusline(MILD, "The working directory has disappeared");
|
||||||
beep();
|
beep();
|
||||||
napms(1200);
|
napms(1200);
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user