From 2c29d66f61cb0e6a9287379456409a636f0efcbd Mon Sep 17 00:00:00 2001 From: Joursoir Date: Mon, 22 Aug 2022 09:18:00 +0300 Subject: cmd_insert: initialize password pointers The standard says: "If ptr is a null pointer, no action occurs". So, remove conditions. --- src/exec-cmd.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/exec-cmd.c b/src/exec-cmd.c index 5ad312c..1e76980 100644 --- a/src/exec-cmd.c +++ b/src/exec-cmd.c @@ -107,7 +107,7 @@ int cmd_insert(int argc, char *argv[]) } } - char *f_pass, *s_pass; + char *f_pass = NULL, *s_pass = NULL; if(!flag_echo) { visible_enter(0); @@ -157,10 +157,8 @@ int cmd_insert(int argc, char *argv[]) out: visible_enter(1); - if(f_pass) - free(f_pass); - if(s_pass) - free(s_pass); + free(f_pass); + free(s_pass); return retval; } -- cgit v1.2.3-18-g5258