Moved the last tcp_stream unref to afetr the last fail-check so that we
authorJeffrey Stedfast <fejj@novell.com>
Mon, 15 Nov 2004 19:42:25 +0000 (19:42 +0000)
committerJeffrey Stedfast <fejj@src.gnome.org>
Mon, 15 Nov 2004 19:42:25 +0000 (19:42 +0000)
2004-11-15  Jeffrey Stedfast  <fejj@novell.com>

* providers/pop3/camel-pop3-store.c (connect_to_server): Moved the
last tcp_stream unref to afetr the last fail-check so that we
won't ever get a double-unref on something we only own one ref on.
(connect_to_server): Unref the tcp_stream if we fail to create an
engine object before returning fail.

camel/ChangeLog
camel/providers/pop3/camel-pop3-store.c

index 991e4d3..a869f47 100644 (file)
@@ -3,6 +3,8 @@
        * providers/pop3/camel-pop3-store.c (connect_to_server): Moved the
        last tcp_stream unref to afetr the last fail-check so that we
        won't ever get a double-unref on something we only own one ref on.
+       (connect_to_server): Unref the tcp_stream if we fail to create an
+       engine object before returning fail.
 
        * providers/imap4/camel-imap4-stream.c (camel_imap4_stream_line):
        Fix bug #69408 by filling our input buffer if inptr == inend.
index 0edff24..ea6d248 100644 (file)
@@ -200,7 +200,7 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Failed to read a valid greeting from POP server %s"),
                                      service->url->host);
-               
+               camel_object_unref (tcp_stream);
                return FALSE;
        }