From: lostd Date: Wed, 22 Oct 2014 19:32:45 +0000 (+0300) Subject: Only free history path if it is valid X-Git-Tag: v1.0~92^2~145 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=d84c3b1079091298e7f92cf9fcf21416f3fe2c6d;p=nnn.git Only free history path if it is valid --- 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;