aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/nnn.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 043ee5b..67ebdf1 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3830,6 +3830,8 @@ nochange:
if (chdir(ipath) == -1) {
printwarn();
+ if (tmp)
+ free(tmp);
goto nochange;
}
@@ -3839,8 +3841,10 @@ nochange:
spawn(shell, "-c", tmp, path, F_CLI);
/* readline finishing touches */
add_history(tmp);
- free(tmp);
}
+
+ if (tmp)
+ free(tmp);
}
#endif
}