aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2022-08-22 09:18:00 +0300
committerJoursoir <chat@joursoir.net>2022-08-22 16:24:26 +0300
commit2c29d66f61cb0e6a9287379456409a636f0efcbd (patch)
tree4f39b9bf93f80289f7ca4dff4208033fe7389476
parent1ced9b35b040714bf4bbf3fab8d5f9e8170d50a5 (diff)
downloadlock-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.c8
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;
}