changeset 35:d718dca81bc9

fix dangling reference
author carl
date Sun, 30 May 2004 17:47:13 -0700
parents fc7f8f3ea90f
children 95607fbef608
files src/dnsbl.cpp
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/dnsbl.cpp	Sun May 30 16:17:44 2004 -0700
+++ b/src/dnsbl.cpp	Sun May 30 17:47:13 2004 -0700
@@ -570,7 +570,7 @@
             discard(nameservers);
             return reject_host;
         }
-        host = *i;
+        host = *i;  // a reference into priv.memory->hosts, which will live until this smtp transaction is closed
         ip   = protected_dns_interface(host, true, &nameservers);
         if (debug_syslog) {
             char buf[200];
@@ -600,7 +600,7 @@
             discard(nameservers);
             return reject_host;
         }
-        host = (*i).first;
+        host = register_string(priv.memory->hosts, (*i).first); // put a copy into priv.memory->hosts, and return that reference
         ip   = (*i).second;
         if (!ip) ip = protected_dns_interface(host, false, NULL);
         if (debug_syslog) {