+2002-05-24 Jeffrey Stedfast <fejj@ximian.com>
+
+ * providers/imap/camel-imap-store.c (connect_to_server): Added
+ some NULL protection fixes.
+
2002-05-22 Jeffrey Stedfast <fejj@ximian.com>
* camel-remote-store.c: Removed from the build. Glory glory
/* 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;
}
/* 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;
}