[evolution-mapi] Bug #627331 - Crash in e_data_book_respond_authenticate_user



commit 779e3aa21b562c2c9a086b402ab834a8af05758a
Author: Milan Crha <mcrha redhat com>
Date:   Wed Aug 25 17:07:53 2010 +0200

    Bug #627331 - Crash in e_data_book_respond_authenticate_user

 src/addressbook/e-book-backend-mapi.c |   15 +++++++++++++++
 src/calendar/e-cal-backend-mapi.c     |   21 +++++++++++++++++++++
 2 files changed, 36 insertions(+), 0 deletions(-)
---
diff --git a/src/addressbook/e-book-backend-mapi.c b/src/addressbook/e-book-backend-mapi.c
index ea57943..6477f8b 100644
--- a/src/addressbook/e-book-backend-mapi.c
+++ b/src/addressbook/e-book-backend-mapi.c
@@ -1058,6 +1058,8 @@ ebbm_operation_cb (OperationBase *op, gboolean cancelled, EBookBackend *backend)
 	} break;
 	}
 
+	if (op->book)
+		g_object_unref (op->book);
 	g_free (op);
 }
 
@@ -1075,6 +1077,9 @@ base_op_abstract (EBookBackend *backend, EDataBook *book, guint32 opid, Operatio
 	priv = ebbm->priv;
 	g_return_if_fail (priv != NULL);
 
+	if (book)
+		g_object_ref (book);
+
 	op = g_new0 (OperationBase, 1);
 	op->ot = ot;
 	op->book = book;
@@ -1097,6 +1102,9 @@ str_op_abstract (EBookBackend *backend, EDataBook *book, guint32 opid, const gch
 	priv = ebbm->priv;
 	g_return_if_fail (priv != NULL);
 
+	if (book)
+		g_object_ref (book);
+
 	op = g_new0 (OperationStr, 1);
 	op->base.ot = ot;
 	op->base.book = book;
@@ -1182,6 +1190,9 @@ ebbm_op_remove_contacts (EBookBackend *backend, EDataBook *book, guint32 opid, G
 	priv = ebbm->priv;
 	g_return_if_fail (priv != NULL);
 
+	if (book)
+		g_object_ref (book);
+
 	op = g_new0 (OperationIDList, 1);
 	op->base.ot = OP_REMOVE_CONTACTS;
 	op->base.book = book;
@@ -1261,6 +1272,9 @@ ebbm_op_authenticate_user (EBookBackend *backend, EDataBook *book, guint32 opid,
 	priv = ebbm->priv;
 	g_return_if_fail (priv != NULL);
 
+	if (book)
+		g_object_ref (book);
+
 	op = g_new0 (OperationAuthenticateUser, 1);
 	op->base.ot = OP_AUTHENTICATE_USER;
 	op->base.book = book;
@@ -1287,6 +1301,7 @@ e_book_backend_mapi_init (EBookBackendMAPI *ebma)
 	priv->conn_lock = g_mutex_new ();
 
 	priv->update_cache = g_cancellable_new ();
+	priv->update_cache_thread = NULL;
 }
 
 static void
diff --git a/src/calendar/e-cal-backend-mapi.c b/src/calendar/e-cal-backend-mapi.c
index b341d3f..d98ed74 100644
--- a/src/calendar/e-cal-backend-mapi.c
+++ b/src/calendar/e-cal-backend-mapi.c
@@ -3232,6 +3232,9 @@ ecbm_operation_cb (OperationBase *op, gboolean cancelled, ECalBackend *backend)
 	} break;
 	}
 
+	if (op->cal)
+		g_object_unref (op->cal);
+
 	g_free (op);
 }
 
@@ -3262,6 +3265,9 @@ base_op_abstract (ECalBackend *backend, EDataCal *cal, EServerMethodContext cont
 	priv = cbmapi->priv;
 	g_return_if_fail (priv != NULL);
 
+	if (cal)
+		g_object_ref (cal);
+
 	op = g_new0 (OperationBase, 1);
 	op->ot = ot;
 	op->cal = cal;
@@ -3284,6 +3290,9 @@ str_op_abstract (ECalBackend *backend, EDataCal *cal, EServerMethodContext conte
 	priv = cbmapi->priv;
 	g_return_if_fail (priv != NULL);
 
+	if (cal)
+		g_object_ref (cal);
+
 	op = g_new0 (OperationStr, 1);
 	op->base.ot = ot;
 	op->base.cal = cal;
@@ -3307,6 +3316,9 @@ str2_op_abstract (ECalBackend *backend, EDataCal *cal, EServerMethodContext cont
 	priv = cbmapi->priv;
 	g_return_if_fail (priv != NULL);
 
+	if (cal)
+		g_object_ref (cal);
+
 	op = g_new0 (OperationStr2, 1);
 	op->base.ot = ot;
 	op->base.cal = cal;
@@ -3363,6 +3375,9 @@ ecbm_op_open (ECalBackend *backend, EDataCal *cal, EServerMethodContext context,
 	priv = cbmapi->priv;
 	g_return_if_fail (priv != NULL);
 
+	if (cal)
+		g_object_ref (cal);
+
 	op = g_new0 (OperationOpen, 1);
 	op->base.ot = OP_OPEN;
 	op->base.cal = cal;
@@ -3393,6 +3408,9 @@ ecbm_op_modify_object (ECalBackend *backend, EDataCal *cal, EServerMethodContext
 	priv = cbmapi->priv;
 	g_return_if_fail (priv != NULL);
 
+	if (cal)
+		g_object_ref (cal);
+
 	op = g_new0 (OperationModify, 1);
 	op->base.ot = OP_MODIFY_OBJECT;
 	op->base.cal = cal;
@@ -3417,6 +3435,9 @@ ecbm_op_remove_object (ECalBackend *backend, EDataCal *cal, EServerMethodContext
 	priv = cbmapi->priv;
 	g_return_if_fail (priv != NULL);
 
+	if (cal)
+		g_object_ref (cal);
+
 	op = g_new0 (OperationRemove, 1);
 	op->base.ot = OP_REMOVE_OBJECT;
 	op->base.cal = cal;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]