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;