From 708f431db8dab6779dd090a1117e556340eca9cc Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Sun, 12 Jul 2020 22:46:47 +0200 Subject: Some minor fixes, in particular, don't free scfg too early --- shared/config-parser.c | 6 +++++- shared/config-parser.h | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'shared') diff --git a/shared/config-parser.c b/shared/config-parser.c index 00f9944..c3cccd6 100644 --- a/shared/config-parser.c +++ b/shared/config-parser.c @@ -575,7 +575,6 @@ bool scfg_parse(struct server_config *scfg, char *buf, bool async, void scfg_delete(struct server_config *scfg) { struct saddr *saddr, *tmp; - struct dns_async *dns; xfree(scfg->name); xfree(scfg->filename); @@ -600,6 +599,11 @@ void scfg_delete(struct server_config *scfg) list_del(&saddr->list); xfree(saddr); } +} + +void scfg_cancel_adns(struct server_config *scfg) +{ + struct dns_async *dns; list_for_each_entry(dns, &scfg->dnslookups, list) { if (dns->pending) diff --git a/shared/config-parser.h b/shared/config-parser.h index ad7e4b2..5b44a46 100644 --- a/shared/config-parser.h +++ b/shared/config-parser.h @@ -108,6 +108,8 @@ bool scfg_parse(struct server_config *scfg, char *buf, bool async, void scfg_delete(struct server_config *scfg); +void scfg_cancel_adns(struct server_config *scfg); + bool scfg_init(struct server_config *scfg, const char *filename); bool strtosockaddrs(const char *str, struct cfg_value *rvalue, bool async); -- cgit v1.2.3