mirror of
https://github.com/Waujito/youtubeUnblock.git
synced 2025-01-22 12:12:45 +00:00
Fix possible memory leak
sni_domains wasn't freeed after default initialization
This commit is contained in:
parent
f4e5cdb328
commit
e8bdd05839
4
args.c
4
args.c
@ -508,6 +508,7 @@ int yparse_args(int argc, char *argv[]) {
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case OPT_SNI_DOMAINS:
|
case OPT_SNI_DOMAINS:
|
||||||
|
free_sni_domains(sect_config->sni_domains);
|
||||||
sect_config->all_domains = 0;
|
sect_config->all_domains = 0;
|
||||||
if (!strcmp(optarg, "all")) {
|
if (!strcmp(optarg, "all")) {
|
||||||
sect_config->all_domains = 1;
|
sect_config->all_domains = 1;
|
||||||
@ -518,6 +519,7 @@ int yparse_args(int argc, char *argv[]) {
|
|||||||
goto error;
|
goto error;
|
||||||
break;
|
break;
|
||||||
case OPT_EXCLUDE_DOMAINS:
|
case OPT_EXCLUDE_DOMAINS:
|
||||||
|
free_sni_domains(sect_config->exclude_sni_domains);
|
||||||
ret = parse_sni_domains(§_config->exclude_sni_domains, optarg, strlen(optarg));
|
ret = parse_sni_domains(§_config->exclude_sni_domains, optarg, strlen(optarg));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto error;
|
goto error;
|
||||||
@ -636,7 +638,7 @@ int yparse_args(int argc, char *argv[]) {
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case OPT_FAKE_CUSTOM_PAYLOAD:
|
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);
|
ret = parse_fake_custom_payload(optarg, §_config->fake_custom_pkt, §_config->fake_custom_pkt_sz);
|
||||||
if (ret == -EINVAL) {
|
if (ret == -EINVAL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user