Networker / SMTP-Client: free a-record lookup reply.
authorWilfried Goesgens <dothebart@citadel.org>
Tue, 17 Apr 2012 20:58:25 +0000 (22:58 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Tue, 17 Apr 2012 20:58:25 +0000 (22:58 +0200)
citadel/modules/network/serv_networkclient.c
citadel/modules/smtp/serv_smtpeventclient.c

index 51db451989d96192576a3a7aad7998fdb11687c1..a8aaa06e5d227c2307dfca49bdcae12756c38216 100644 (file)
@@ -159,6 +159,10 @@ void DeleteNetworker(void *vptr)
        FreeStrBuf(&NW->Url);
        FreeStrBuf(&NW->IO.ErrMsg);
        FreeAsyncIOContents(&NW->IO);
+       if (NW->HostLookup.VParsedDNSReply != NULL) {
+               NW->HostLookup.DNSReplyFree(NW->HostLookup.VParsedDNSReply);
+               NW->HostLookup.VParsedDNSReply = NULL;
+       }
        free(NW);
 }
 
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)