]> Sergey Matveev's repositories - nnn.git/commitdiff
no need to check for NULL before free
authorHiltjo Posthuma <hiltjo@codemadness.org>
Wed, 17 Dec 2014 11:54:57 +0000 (11:54 +0000)
committerlostd <lostd@2f30.org>
Thu, 18 Dec 2014 09:02:34 +0000 (11:02 +0200)
noice.c

diff --git a/noice.c b/noice.c
index b50cddfe5b260b963900f28f172aac29264f6ba5..f62619a2311a5949812e7ee6fd0c2ccdf70a8cb9 100644 (file)
--- a/noice.c
+++ b/noice.c
@@ -545,10 +545,8 @@ begin:
 
        /* Find cur from history */
        cur = dentfind(dents, n, path, oldpath);
-       if (oldpath != NULL) {
-               free(oldpath);
-               oldpath = NULL;
-       }
+       free(oldpath);
+       oldpath = NULL;
 
        for (;;) {
 redraw: