diff options
author | Joursoir <chat@joursoir.net> | 2022-08-22 09:18:00 +0300 |
---|---|---|
committer | Joursoir <chat@joursoir.net> | 2022-08-22 16:24:26 +0300 |
commit | 2c29d66f61cb0e6a9287379456409a636f0efcbd (patch) | |
tree | 4f39b9bf93f80289f7ca4dff4208033fe7389476 | |
parent | 1ced9b35b040714bf4bbf3fab8d5f9e8170d50a5 (diff) | |
download | lock-password-2c29d66f61cb0e6a9287379456409a636f0efcbd.tar.gz lock-password-2c29d66f61cb0e6a9287379456409a636f0efcbd.tar.bz2 lock-password-2c29d66f61cb0e6a9287379456409a636f0efcbd.zip |
cmd_insert: initialize password pointers
The standard says: "If ptr is a null pointer, no action occurs".
So, remove conditions.
-rw-r--r-- | src/exec-cmd.c | 8 |
1 files changed, 3 insertions, 5 deletions
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; } |