Browse Source

Free readline buffer in corner cases

master
Arun Prakash Jana 5 years ago
parent
commit
3e4797f728
No known key found for this signature in database GPG Key ID: A75979F35C080412
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      src/nnn.c

+ 5
- 1
src/nnn.c View File

@@ -3830,6 +3830,8 @@ nochange:


if (chdir(ipath) == -1) { if (chdir(ipath) == -1) {
printwarn(); printwarn();
if (tmp)
free(tmp);
goto nochange; goto nochange;
} }


@@ -3839,8 +3841,10 @@ nochange:
spawn(shell, "-c", tmp, path, F_CLI); spawn(shell, "-c", tmp, path, F_CLI);
/* readline finishing touches */ /* readline finishing touches */
add_history(tmp); add_history(tmp);
free(tmp);
} }

if (tmp)
free(tmp);
} }
#endif #endif
} }


Loading…
Cancel
Save