]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/smtp/serv_smtpeventclient.c
Networker / SMTP-Client: free a-record lookup reply.
[citadel.git] / citadel / modules / smtp / serv_smtpeventclient.c
index 4a8cfcda9e169a1bf69920c8299bbd3b04230981..ffdc63d0ea3831442305b3ddaf5d5a822862ee57 100644 (file)
@@ -388,10 +388,19 @@ eNextState get_one_mx_host_ip_done(AsyncIO *IO)
                        addr->sin_port   = htons(DefaultMXPort);
                }
                Msg->mx_host = Msg->pCurrRelay->Host;
+               if (Msg->HostLookup.VParsedDNSReply != NULL) {
+                       Msg->HostLookup.DNSReplyFree(Msg->HostLookup.VParsedDNSReply);
+                       Msg->HostLookup.VParsedDNSReply = NULL;
+               }
                return mx_connect_ip(IO);
        }
-       else
+       else {
+               if (Msg->HostLookup.VParsedDNSReply != NULL) {
+                       Msg->HostLookup.DNSReplyFree(Msg->HostLookup.VParsedDNSReply);
+                       Msg->HostLookup.VParsedDNSReply = NULL;
+               }
                return FailOneAttempt(IO);
+       }
 }
 
 eNextState get_one_mx_host_ip(AsyncIO *IO)