From d84c3b1079091298e7f92cf9fcf21416f3fe2c6d Mon Sep 17 00:00:00 2001 From: lostd Date: Wed, 22 Oct 2014 22:32:45 +0300 Subject: [PATCH] Only free history path if it is valid --- noice.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/noice.c b/noice.c index 4626286e..1d0a0c96 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;