From e8bdd05839661a1822e1cd0be4bf688b40d578f2 Mon Sep 17 00:00:00 2001 From: Vadim Vetrov Date: Mon, 9 Dec 2024 01:28:16 +0300 Subject: [PATCH] Fix possible memory leak sni_domains wasn't freeed after default initialization --- args.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/args.c b/args.c index b4c0bfd..bdf262a 100644 --- a/args.c +++ b/args.c @@ -508,6 +508,7 @@ int yparse_args(int argc, char *argv[]) { break; case OPT_SNI_DOMAINS: + free_sni_domains(sect_config->sni_domains); sect_config->all_domains = 0; if (!strcmp(optarg, "all")) { sect_config->all_domains = 1; @@ -518,6 +519,7 @@ int yparse_args(int argc, char *argv[]) { goto error; break; case OPT_EXCLUDE_DOMAINS: + free_sni_domains(sect_config->exclude_sni_domains); ret = parse_sni_domains(§_config->exclude_sni_domains, optarg, strlen(optarg)); if (ret < 0) goto error; @@ -636,7 +638,7 @@ int yparse_args(int argc, char *argv[]) { break; case OPT_FAKE_CUSTOM_PAYLOAD: - SFREE(sect_config->udp_dport_range); + SFREE(sect_config->fake_custom_pkt); ret = parse_fake_custom_payload(optarg, §_config->fake_custom_pkt, §_config->fake_custom_pkt_sz); if (ret == -EINVAL) {