aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar lostd <lostd@2f30.org>2014-10-22 22:32:45 +0300
committerGravatar lostd <lostd@2f30.org>2014-10-22 22:32:45 +0300
commitd84c3b1079091298e7f92cf9fcf21416f3fe2c6d (patch)
tree65d15c3d6f41240232a3eef0363f7daddfc47c59
parent81239754064e6b5bfeeeb90d0043a3e48f13f65c (diff)
downloadnnn-d84c3b1079091298e7f92cf9fcf21416f3fe2c6d.tar.gz
Only free history path if it is valid
-rw-r--r--noice.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/noice.c b/noice.c
index 4626286..1d0a0c9 100644
--- a/noice.c
+++ b/noice.c
@@ -604,8 +604,10 @@ begin:
/* Find cur from history */
cur = dentfind(dents, n, path, hpath);
- free(hpath);
- hpath = NULL;
+ if (hpath != NULL) {
+ free(hpath);
+ hpath = NULL;
+ }
for (;;) {
int nlines;