aboutsummaryrefslogtreecommitdiffstats
path: root/src/nnn.c
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-04-12 20:06:29 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-04-12 20:06:29 +0530
commit3e4797f7289e16c61cf5af9abdec456e0049c67d (patch)
tree14dd2dd149247c16882d206359ebd4065283f753 /src/nnn.c
parent7b07e8e0e899c3f7d9521fd48babc4eab0bc5192 (diff)
downloadnnn-3e4797f7289e16c61cf5af9abdec456e0049c67d.tar.gz
Free readline buffer in corner cases
Diffstat (limited to 'src/nnn.c')
-rw-r--r--src/nnn.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 043ee5b..67ebdf1 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3830,6 +3830,8 @@ nochange:
if (chdir(ipath) == -1) {
printwarn();
+ if (tmp)
+ free(tmp);
goto nochange;
}
@@ -3839,8 +3841,10 @@ nochange:
spawn(shell, "-c", tmp, path, F_CLI);
/* readline finishing touches */
add_history(tmp);
- free(tmp);
}
+
+ if (tmp)
+ free(tmp);
}
#endif
}