diff options
Diffstat (limited to 'camel/providers/smtp/camel-smtp-transport.c')
-rw-r--r-- | camel/providers/smtp/camel-smtp-transport.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c index 83bb39c577..84948f91eb 100644 --- a/camel/providers/smtp/camel-smtp-transport.c +++ b/camel/providers/smtp/camel-smtp-transport.c @@ -891,10 +891,8 @@ smtp_helo (CamelSmtpTransport *transport, CamelException *ex) camel_exception_clear (&err); - if (host) { - if (host->h_name && *host->h_name) - name = g_strdup (host->h_name); - camel_free_host (host); + if (host && host->h_name && *host->h_name) { + name = g_strdup (host->h_name); } else { #ifdef ENABLE_IPv6 char ip[MAXHOSTNAMELEN + 1]; @@ -911,7 +909,10 @@ smtp_helo (CamelSmtpTransport *transport, CamelException *ex) transport->localaddr->address[3]); #endif } - + + if (host) + camel_free_host (host); + /* hiya server! how are you today? */ if (transport->flags & CAMEL_SMTP_TRANSPORT_IS_ESMTP) cmdbuf = g_strdup_printf ("EHLO %s\r\n", name); |