Fix memory leak

buf variable is not freed properly from the hydra_receive_line call
This commit is contained in:
David Maciejak 2019-06-04 13:53:08 +08:00 committed by GitHub
parent 2f1c1438ea
commit 85d51ba494
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}
}