From 2824192cc53f020e87da37e02a91c82b2b3acaac Mon Sep 17 00:00:00 2001 From: jsteube Date: Tue, 14 Feb 2017 16:40:08 +0100 Subject: [PATCH] Fix several memory leaks in pidfile handling in case a hashcat instance is already running --- src/pidfile.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/pidfile.c b/src/pidfile.c index 5f5bb4b5b..f23d53ccd 100644 --- a/src/pidfile.c +++ b/src/pidfile.c @@ -46,6 +46,10 @@ static int check_running_process (hashcat_ctx_t *hashcat_ctx) { event_log_error (hashcat_ctx, "Already an instance running on pid %u", pd->pid); + hcfree (pd); + + hcfree (pidbin); + return -1; } @@ -70,12 +74,17 @@ static int check_running_process (hashcat_ctx_t *hashcat_ctx) { event_log_error (hashcat_ctx, "Already an instance %s running on pid %d", pidbin2, pd->pid); + hcfree (pd); + + hcfree (pidbin); + hcfree (pidbin2); + return -1; } } - hcfree (pidbin2); hcfree (pidbin); + hcfree (pidbin2); #endif }