Skip to content

Commit

Permalink
dns_client: fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
pymumu committed Mar 2, 2025
1 parent adeb3e8 commit b525170
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/dns_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -3183,6 +3183,7 @@ static int _dns_client_verify_common_name(struct dns_server_info *server_info, X
tlog(TLOG_DEBUG, "peer SAN: %s", dns->data);
if (_dns_client_tls_matchName(tls_host_verify, (char *)dns->data, dns->length) == 0) {
tlog(TLOG_DEBUG, "peer SAN match: %s", dns->data);
GENERAL_NAMES_free(alt_names);
return 0;
}
} break;
Expand All @@ -3196,6 +3197,9 @@ static int _dns_client_verify_common_name(struct dns_server_info *server_info, X
errout:
tlog(TLOG_WARN, "server %s CN is invalid, peer CN: %s, expect CN: %s", server_info->ip, peer_CN, tls_host_verify);
server_info->prohibit = 1;
if (alt_names) {
GENERAL_NAMES_free(alt_names);
}
return -1;
}

Expand Down

0 comments on commit b525170

Please sign in to comment.