From 85d51ba494074872163d8ed54e863a669de02768 Mon Sep 17 00:00:00 2001 From: David Maciejak Date: Tue, 4 Jun 2019 13:53:08 +0800 Subject: [PATCH] Fix memory leak buf variable is not freed properly from the hydra_receive_line call --- hydra-ldap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hydra-ldap.c b/hydra-ldap.c index e00265e..d04d180 100644 --- a/hydra-ldap.c +++ b/hydra-ldap.c @@ -393,6 +393,7 @@ void service_ldap(char *ip, int32_t sp, unsigned char options, char *miscptr, FI if ((buf[0] != 0 && buf[9] == 0) || (buf[0] != 32 && buf[9] == 32)) { /* TLS option negociation goes well, now trying to connect */ + free(buf); if ((hydra_connect_to_ssl(sock, hostname) == -1) && verbose) { hydra_report(stderr, "[ERROR] Can't use TLS\n"); hydra_child_exit(1); @@ -403,6 +404,7 @@ void service_ldap(char *ip, int32_t sp, unsigned char options, char *miscptr, FI } } else { hydra_report(stderr, "[ERROR] Can't use TLS %s\n", buf); + free(buf); hydra_child_exit(1); } }