diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-05-24 13:15:31 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-05-24 13:15:31 +0800 |
commit | e7d495a63b0074461e738b33d949889d3d304d57 (patch) | |
tree | 4d5da9636800208e52cf025578e70aed8a8417dc /camel/providers | |
parent | b8924866d1e8dc23fd8f3650620fc3aa7b951e75 (diff) | |
download | gsoc2013-evolution-e7d495a63b0074461e738b33d949889d3d304d57.tar.gz gsoc2013-evolution-e7d495a63b0074461e738b33d949889d3d304d57.tar.zst gsoc2013-evolution-e7d495a63b0074461e738b33d949889d3d304d57.zip |
Added some NULL protection fixes.
2002-05-24 Jeffrey Stedfast <fejj@ximian.com>
* providers/imap/camel-imap-store.c (connect_to_server): Added
some NULL protection fixes.
svn path=/trunk/; revision=16997
Diffstat (limited to 'camel/providers')
-rw-r--r-- | camel/providers/imap/camel-imap-store.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index d1d42b690c..312f6c2fb6 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -557,10 +557,16 @@ connect_to_server (CamelService *service, int ssl_mode, int try_starttls, CamelE /* Read the greeting, if any. FIXME: deal with PREAUTH */ if (camel_imap_store_recv_line (store, &buf, ex) < 0) { - camel_object_unref (CAMEL_OBJECT (store->istream)); - camel_object_unref (CAMEL_OBJECT (store->ostream)); - store->istream = NULL; - store->ostream = NULL; + if (store->istream) { + camel_object_unref (CAMEL_OBJECT (store->istream)); + store->istream = NULL; + } + + if (store->ostream) { + camel_object_unref (CAMEL_OBJECT (store->ostream)); + store->ostream = NULL; + } + store->connected = FALSE; return FALSE; } @@ -568,10 +574,17 @@ connect_to_server (CamelService *service, int ssl_mode, int try_starttls, CamelE /* get the imap server capabilities */ if (!imap_get_capability (service, ex)) { - camel_object_unref (CAMEL_OBJECT (store->istream)); - camel_object_unref (CAMEL_OBJECT (store->ostream)); - store->istream = NULL; - store->ostream = NULL; + if (store->istream) { + camel_object_unref (CAMEL_OBJECT (store->istream)); + store->istream = NULL; + } + + if (store->ostream) { + camel_object_unref (CAMEL_OBJECT (store->ostream)); + store->ostream = NULL; + } + + store->connected = FALSE; return FALSE; } |