From: Jeremy Harris Date: Tue, 13 Mar 2018 13:52:26 +0000 (+0000) Subject: Mark variables unused before release of store in the daemon loop X-Git-Tag: exim-4_91_RC1~7 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e04bfa34ece182e956a33fdf8986813f245d76f3;p=exim.git Mark variables unused before release of store in the daemon loop --- diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index 786df0506..344671add 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -141,6 +141,11 @@ JH/27 Bug 2251: Fix ldap lookups that return a single attribute having zero- HS/02 Support Avast multiline protoocol, this allows passing flags to newer versions of the scanner. +JH/28 Ensure that variables possibly set during message acceptance are marked + dead before release of memory in the daemon loop. This stops complaints + about them when the debug_store option is enabled. Discovered specifically + for sender_rate_period, but applies to a whole set of variables. + Exim version 4.90 ----------------- diff --git a/src/src/daemon.c b/src/src/daemon.c index 476ed296b..4a89afe74 100644 --- a/src/src/daemon.c +++ b/src/src/daemon.c @@ -563,18 +563,13 @@ if (pid == 0) /* Reclaim up the store used in accepting this message */ - return_path = sender_address = NULL; - authenticated_sender = NULL; - sending_ip_address = NULL; - deliver_host_address = deliver_host = - deliver_domain_orig = deliver_localpart_orig = NULL; - dnslist_domain = dnslist_matched = NULL; - callout_address = NULL; -#ifndef DISABLE_DKIM - dkim_cur_signer = NULL; -#endif - acl_var_m = NULL; - store_reset(reset_point); + { + int r = receive_messagecount; + BOOL q = queue_only_policy; + smtp_reset(reset_point); + queue_only_policy = q; + receive_messagecount = r; + } /* If queue_only is set or if there are too many incoming connections in existence, session_local_queue_only will be TRUE. If it is not, check diff --git a/src/src/functions.h b/src/src/functions.h index 1f201fc69..4e60ec2c8 100644 --- a/src/src/functions.h +++ b/src/src/functions.h @@ -442,6 +442,7 @@ extern void smtp_log_no_mail(void); extern void smtp_message_code(uschar **, int *, uschar **, uschar **, BOOL); extern void smtp_proxy_tls(uschar *, size_t, int *, int); extern BOOL smtp_read_response(smtp_inblock *, uschar *, int, int, int); +extern void smtp_reset(void *); extern void smtp_respond(uschar *, int, BOOL, uschar *); extern void smtp_notquit_exit(uschar *, uschar *, uschar *, ...); extern void smtp_port_for_connect(host_item *, int); diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c index a0cc581c2..a229721cf 100644 --- a/src/src/smtp_in.c +++ b/src/src/smtp_in.c @@ -1947,13 +1947,13 @@ return TRUE; *************************************************/ /* This function is called whenever the SMTP session is reset from -within either of the setup functions. +within either of the setup functions; also from the daemon loop. Argument: the stacking pool storage reset point Returns: nothing */ -static void +void smtp_reset(void *reset_point) { recipients_list = NULL; @@ -1997,9 +1997,8 @@ bmi_verdicts = NULL; #endif dnslist_domain = dnslist_matched = NULL; #ifndef DISABLE_DKIM -dkim_signers = NULL; -dkim_disable_verify = FALSE; -dkim_collect_input = FALSE; +dkim_cur_signer = dkim_signers = NULL; +dkim_disable_verify = dkim_collect_input = FALSE; #endif dsn_ret = 0; dsn_envid = NULL; @@ -2008,10 +2007,7 @@ deliver_host = deliver_host_address = NULL; /* Can be set by ACL */ prdr_requested = FALSE; #endif #ifdef SUPPORT_SPF -spf_header_comment = NULL; -spf_received = NULL; -spf_result = NULL; -spf_smtp_comment = NULL; +spf_header_comment = spf_received = spf_result = spf_smtp_comment = NULL; #endif #ifdef SUPPORT_I18N message_smtputf8 = FALSE;