diff options
author | Joursoir <chat@joursoir.net> | 2021-03-03 20:21:20 +0000 |
---|---|---|
committer | Joursoir <chat@joursoir.net> | 2021-03-03 20:21:20 +0000 |
commit | 1c5f7fd29fce3008218d781ab148a6974e898cac (patch) | |
tree | 54e1da521c476ca510e5db6cb830c0e58049b665 /src/main.c | |
parent | 8a48afccb97462b0dc261e8c99c0825295ebc019 (diff) | |
download | lock-password-1c5f7fd29fce3008218d781ab148a6974e898cac.tar.gz lock-password-1c5f7fd29fce3008218d781ab148a6974e898cac.tar.bz2 lock-password-1c5f7fd29fce3008218d781ab148a6974e898cac.zip |
some chore and delete useless thing
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -290,18 +290,21 @@ int cmd_generate(int argc, char *argv[]) errprint(1, "You can't generate password for directory\n"); // generate password - char g_pass[pass_length]; - gen_password(g_pass, pass_length); + char *g_pass; + g_pass = gen_password(pass_length); result = insert_pass(path, g_pass); - if(result) + if(result) { + free(g_pass); errprint(1, "Can't add password to LockPassword"); + } if(flag_copy) copy_outside(g_pass); else printf("Generated password: %s\n", g_pass); printf("Password added successfully for %s\n", path); + free(g_pass); return 0; } |