From 554de99b229180451331f81adc3f6195bf525878 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Fri, 30 Mar 2001 00:31:20 +0000 Subject: Not quite finished but checking in for some local frobbing. 2001-03-29 Not Zed * providers/smtp/camel-smtp-transport.c (smtp_connect): Free host name info when done ... blah blah. * camel-sasl-kerberos4.c (krb4_challenge): Free host name info after we're done with it. * camel-sasl-digest-md5.c (digest_md5_challenge): Free host name info after we're done with it. * camel-remote-store.c (remote_connect): Free the host name info from get_host after we're finished with it. * camel-service.c (camel_get_host_byname): New function to lookup a name, and still be cancellable. (camel_free_host): And a function to free the structure returned. (camel_service_gethost): Call get_host_byname for this. svn path=/trunk/; revision=9033 --- camel/providers/pop3/camel-pop3-store.c | 3 +++ camel/providers/smtp/camel-smtp-transport.c | 1 + 2 files changed, 4 insertions(+) (limited to 'camel/providers') diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c index 17b2fdf8ee..4ebb92dd2b 100644 --- a/camel/providers/pop3/camel-pop3-store.c +++ b/camel/providers/pop3/camel-pop3-store.c @@ -169,9 +169,12 @@ connect_to_server (CamelService *service, CamelException *ex) /* Need to copy hostname, because krb_realmofhost will * call gethostbyname as well, and gethostbyname uses * static storage. + * This isn't really necessary since gethost() returns a copy anyway, + * but for simplicity leave the old code here - NZ */ h = camel_service_gethost (service, ex); hostname = g_strdup (h->h_name); + camel_free_host(h); fd = CAMEL_STREAM_FS (CAMEL_REMOTE_STORE (service)->ostream)->fd; diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c index a6572d4bdc..f2c344ebba 100644 --- a/camel/providers/smtp/camel-smtp-transport.c +++ b/camel/providers/smtp/camel-smtp-transport.c @@ -255,6 +255,7 @@ smtp_connect (CamelService *service, CamelException *ex) #endif /* HAVE_NSS */ ret = camel_tcp_stream_connect (CAMEL_TCP_STREAM (tcp_stream), h, port); + camel_free_host(h); if (ret == -1) { camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, _("Could not connect to %s (port %d): %s"), -- cgit v1.2.3