mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-13 19:28:56 +00:00
Fix some memory leaks in case hashcat aborts due to command line parameter settings
This commit is contained in:
parent
b301a6746f
commit
33a2b17b61
14
src/main.c
14
src/main.c
@ -1173,6 +1173,8 @@ int main (int argc, char **argv)
|
||||
|
||||
if (user_options_init (hashcat_ctx) == -1)
|
||||
{
|
||||
hashcat_destroy (hashcat_ctx);
|
||||
|
||||
hcfree (hashcat_ctx);
|
||||
|
||||
return -1;
|
||||
@ -1182,6 +1184,10 @@ int main (int argc, char **argv)
|
||||
|
||||
if (user_options_getopt (hashcat_ctx, argc, argv) == -1)
|
||||
{
|
||||
user_options_destroy (hashcat_ctx);
|
||||
|
||||
hashcat_destroy (hashcat_ctx);
|
||||
|
||||
hcfree (hashcat_ctx);
|
||||
|
||||
return -1;
|
||||
@ -1189,6 +1195,10 @@ int main (int argc, char **argv)
|
||||
|
||||
if (user_options_sanity (hashcat_ctx) == -1)
|
||||
{
|
||||
user_options_destroy (hashcat_ctx);
|
||||
|
||||
hashcat_destroy (hashcat_ctx);
|
||||
|
||||
hcfree (hashcat_ctx);
|
||||
|
||||
return -1;
|
||||
@ -1213,6 +1223,10 @@ int main (int argc, char **argv)
|
||||
{
|
||||
printf ("%s\n", VERSION_TAG);
|
||||
|
||||
user_options_destroy (hashcat_ctx);
|
||||
|
||||
hashcat_destroy (hashcat_ctx);
|
||||
|
||||
hcfree (hashcat_ctx);
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user