From 64ca3aead24297952fe330e405c33d12ccaf12ff Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Mon, 11 Apr 2022 16:57:49 +0200 Subject: [PATCH] Fix memory leak in radmin2 `msg` is calloc'd a few lines above via `msg = buffer2message(buffer);`. The check afterwards either exits the process on success or restarts the loop without free'ing `msg`. --- hydra-radmin2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hydra-radmin2.c b/hydra-radmin2.c index 8c417d3..bc6b461 100644 --- a/hydra-radmin2.c +++ b/hydra-radmin2.c @@ -366,6 +366,7 @@ void service_radmin2(char *ip, int32_t sp, unsigned char options, char *miscptr, hydra_report(stderr, "Error: Child with pid %d terminating, protocol error\n", (int32_t)getpid()); hydra_child_exit(2); } + free(msg); } #endif }