aboutsummaryrefslogtreecommitdiff
path: root/passgen.c
diff options
context:
space:
mode:
authorNicholas Tay <nick@windblume.net>2022-01-14 00:15:48 +1100
committerNicholas Tay <nick@windblume.net>2022-01-14 00:15:48 +1100
commit0ae79b0b8122b99aed41c5557b2c2ce57c03b0f6 (patch)
tree4eee6c4d464112970946947171e8a4486096e1cc /passgen.c
parent0f1bc3f8788bdbad88840cbbffc6d4787629c24e (diff)
downloadpassgen-0ae79b0b8122b99aed41c5557b2c2ce57c03b0f6.tar.gz
passgen-0ae79b0b8122b99aed41c5557b2c2ce57c03b0f6.tar.bz2
passgen-0ae79b0b8122b99aed41c5557b2c2ce57c03b0f6.zip
Fix direct grammar string passing invalid free
Diffstat (limited to 'passgen.c')
-rw-r--r--passgen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/passgen.c b/passgen.c
index 6f3670d..88d4a76 100644
--- a/passgen.c
+++ b/passgen.c
@@ -213,7 +213,8 @@ cleanup:
#ifdef USE_WINCRYPT
CryptReleaseContext(win_rng, 0);
#endif
- if (grammar != grammar_buf)
+ /* TODO: this && kinda sucks, would like a better but still fast way */
+ if (grammar != grammar_buf && grammar != argv[1])
free(grammar);
if (password != password_buf)
free(password);