]> Sergey Matveev's repositories - nnn.git/commitdiff
Only free history path if it is valid
authorlostd <lostd@2f30.org>
Wed, 22 Oct 2014 19:32:45 +0000 (22:32 +0300)
committerlostd <lostd@2f30.org>
Wed, 22 Oct 2014 19:32:45 +0000 (22:32 +0300)
noice.c

diff --git a/noice.c b/noice.c
index 4626286edd4f51c400e14bbf0ec7833b7eaed164..1d0a0c96da9557d3b0956b51798b179c8d2254e4 100644 (file)
--- 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;