Memory management: drop $acl_m_ variables explicitly as they go out-of-scope
authorJeremy Harris <jgh146exb@wizmail.org>
Fri, 24 Feb 2017 15:00:40 +0000 (15:00 +0000)
committerPhil Pennock <pdp@exim.org>
Fri, 24 Feb 2017 18:03:44 +0000 (13:03 -0500)
between message receptions in an SMTP connection

(cherry picked from commit b83fa5fa89071dab0637c0e58ba8e5c1b829149b)
Signed-off-by: Phil Pennock <pdp@exim.org>
src/src/daemon.c
test/log/0372
test/scripts/0000-Basic/0372
test/stderr/0372
test/stdout/0372

index d4fe7759c92162862aa1cb4d9317e5854138cbe4..ea0c2226259f062a5778c9441275fcde70aea82e 100644 (file)
@@ -573,6 +573,7 @@ if (pid == 0)
 #ifndef DISABLE_DKIM
     dkim_cur_signer = NULL;
 #endif
+    acl_var_m = NULL;
     store_reset(reset_point);
 
     /* If queue_only is set or if there are too many incoming connections in
index 3830932ef822b50b5e7f87da8a5091082e5bdebb..741559dff84a6c0f79f665bd3a87e5177c7ac768 100644 (file)
@@ -6,3 +6,7 @@
 1999-03-02 09:44:33 10HmaZ-0005vi-00 Completed
 1999-03-02 09:44:33 10HmaX-0005vi-00 <= <> H=host2.name [4.3.2.1] U=CALLER P=smtp S=sss
 1999-03-02 09:44:33 10HmaX-0005vi-00 Error in system filter: failed to expand "  acl_c0="$acl_c0"\n  acl_c1="$acl_c1"\n  acl_c2="$acl_c2"\n  acl_c3="$acl_c3"\n  acl_c4="$acl_c4"\n  acl_c5="$acl_c5"\n  acl_c6="$acl_c6"\n  acl_c7="$acl_c7"\n  acl_c8="$acl_c8"\n  acl_c9="$acl_c9"\n  acl_m0="$acl_m0"\n  acl_m1="$acl_m1"\n  acl_m2="$acl_m2"\n  acl_m3="$acl_m3"\n  acl_m4="$acl_m4"\n  acl_m5="$acl_m5"\n  acl_m6="$acl_m6"\n  acl_m7="$acl_m7"\n  acl_m8="$acl_m8"\n  acl_m9="$acl_m9"\n  acl_m_foo="$acl_m_foo"\n  acl_m_bar="$acl_m_bar"\n  acl_c_foo="$acl_c_foo"\n  acl_c_bar="$acl_c_bar"\n" in logwrite command: unknown variable name "acl_c1" (strict_acl_vars is set)
+
+******** SERVER ********
+1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225
+1999-03-02 09:44:33 10HmbA-0005vi-00 <= <> H=localhost (test) [127.0.0.1] P=smtp S=sss
index 246c9bbda1fa8c41e7aabc445a928dcfe76e06ca..b7e4022636b5f43855ba0dc448b767b746e56128 100644 (file)
@@ -17,4 +17,22 @@ data
 .
 quit
 ****
+#
+exim -DSERVER=server -bd -oX PORT_D
+****
+client 127.0.0.1 PORT_D
+??? 220
+HELO test
+??? 250
+MAIL FROM:<>
+??? 250
+RCPT TO:<x@y>
+??? 250
+DATA
+??? 354
+.
+??? 250
+QUIT
+***
+killdaemon
 no_msglog_check
index c30c476b28bdd5d0f179010aad1de4a80cef0a37..6513fc2b68fc1c4c0a0106454ae3f38883f899c7 100644 (file)
@@ -124,3 +124,33 @@ LOG: smtp_connection MAIN
   SMTP connection from CALLER closed by QUIT
 ----- System filter -----
 1999-03-02 09:44:33 10HmaX-0005vi-00 Error in system filter: failed to expand "  acl_c0="$acl_c0"\n  acl_c1="$acl_c1"\n  acl_c2="$acl_c2"\n  acl_c3="$acl_c3"\n  acl_c4="$acl_c4"\n  acl_c5="$acl_c5"\n  acl_c6="$acl_c6"\n  acl_c7="$acl_c7"\n  acl_c8="$acl_c8"\n  acl_c9="$acl_c9"\n  acl_m0="$acl_m0"\n  acl_m1="$acl_m1"\n  acl_m2="$acl_m2"\n  acl_m3="$acl_m3"\n  acl_m4="$acl_m4"\n  acl_m5="$acl_m5"\n  acl_m6="$acl_m6"\n  acl_m7="$acl_m7"\n  acl_m8="$acl_m8"\n  acl_m9="$acl_m9"\n  acl_m_foo="$acl_m_foo"\n  acl_m_bar="$acl_m_bar"\n  acl_c_foo="$acl_c_foo"\n  acl_c_bar="$acl_c_bar"\n" in logwrite command: unknown variable name "acl_c1" (strict_acl_vars is set)
+----- System filter -----
+  acl_c0="value for c0 is ip: 127.0.0.1"
+  acl_c1=""
+  acl_c2=""
+  acl_c3=""
+  acl_c4=""
+  acl_c5="c5 has a newline
+there!"
+  acl_c6=""
+  acl_c7=""
+  acl_c8=""
+  acl_c9="value for c9 is name: localhost"
+  acl_m0="value for m0 is local_part: x"
+  acl_m1=""
+  acl_m2=""
+  acl_m3=""
+  acl_m4=""
+  acl_m5="value for m5 contains newline
+there!"
+  acl_m6=""
+  acl_m7=""
+  acl_m8=""
+  acl_m9="value for m9 is domain: y"
+  acl_m_foo="value for mfoo is local_part: x"
+  acl_m_bar="value for mbar is domain: y"
+  acl_c_foo="value for c_foo is ip: 127.0.0.1"
+  acl_c_bar="value for c_bar is name: localhost"
+-------------------------
+
+******** SERVER ********
index d5a6b438bb0d33f0e0ee84c85d6a39d85888155c..381d1a6ef1083e90d43746246d3e972f1f56a73b 100644 (file)
 354 Enter message, ending with "." on a line by itself\r
 250 OK id=10HmaX-0005vi-00\r
 221 myhost.test.ex closing connection\r
+Connecting to 127.0.0.1 port 1225 ... connected
+??? 220
+<<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+>>> HELO test
+??? 250
+<<< 250 myhost.test.ex Hello localhost [127.0.0.1]
+>>> MAIL FROM:<>
+??? 250
+<<< 250 OK
+>>> RCPT TO:<x@y>
+??? 250
+<<< 250 Accepted
+>>> DATA
+??? 354
+<<< 354 Enter message, ending with "." on a line by itself
+>>> .
+??? 250
+<<< 250 OK id=10HmbA-0005vi-00
+>>> QUIT
+>>> ***
+>>> killdaemon
+>>> no_msglog_check
+End of script