[evolution-mapi/gnome-3-4] Could free uninitialized memory in e_mapi_connection_close_folder()
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-mapi/gnome-3-4] Could free uninitialized memory in e_mapi_connection_close_folder()
- Date: Thu, 12 Jul 2012 12:51:23 +0000 (UTC)
commit 6337f3fd295426525a3e4ff9e1e3613e512fa6aa
Author: Milan Crha <mcrha redhat com>
Date: Thu Jul 12 14:50:54 2012 +0200
Could free uninitialized memory in e_mapi_connection_close_folder()
src/addressbook/e-book-backend-mapi-contacts.c | 6 ++++--
src/camel/camel-mapi-folder.c | 6 ++++--
2 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/addressbook/e-book-backend-mapi-contacts.c b/src/addressbook/e-book-backend-mapi-contacts.c
index 7cc87a3..0fa79a8 100644
--- a/src/addressbook/e-book-backend-mapi-contacts.c
+++ b/src/addressbook/e-book-backend-mapi-contacts.c
@@ -664,7 +664,7 @@ ebbm_contacts_get_contact (EBookBackendMAPI *ebma, GCancellable *cancellable, co
mapi_id_t mid;
mapi_object_t obj_folder;
struct TransferContactData tc = { 0 };
- gboolean status;
+ gboolean status, has_obj_folder;
GError *mapi_error = NULL;
e_return_data_book_error_if_fail (ebma != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
@@ -700,6 +700,7 @@ ebbm_contacts_get_contact (EBookBackendMAPI *ebma, GCancellable *cancellable, co
}
status = ebbm_contacts_open_folder (ebmac, conn, &obj_folder, cancellable, &mapi_error);
+ has_obj_folder = status;
if (status) {
status = e_mapi_util_mapi_id_from_string (id, &mid);
@@ -715,7 +716,8 @@ ebbm_contacts_get_contact (EBookBackendMAPI *ebma, GCancellable *cancellable, co
e_mapi_connection_transfer_object (conn, &obj_folder, mid, transfer_contact_cb, &tc, cancellable, &mapi_error);
}
- e_mapi_connection_close_folder (conn, &obj_folder, cancellable, &mapi_error);
+ if (has_obj_folder)
+ e_mapi_connection_close_folder (conn, &obj_folder, cancellable, &mapi_error);
if (tc.contact) {
*vcard = e_vcard_to_string (E_VCARD (tc.contact), EVC_FORMAT_VCARD_30);
diff --git a/src/camel/camel-mapi-folder.c b/src/camel/camel-mapi-folder.c
index ee65b77..1d0802f 100644
--- a/src/camel/camel-mapi-folder.c
+++ b/src/camel/camel-mapi-folder.c
@@ -731,7 +731,7 @@ gather_object_summary_cb (EMapiConnection *conn,
gboolean
camel_mapi_folder_fetch_summary (CamelFolder *folder, GCancellable *cancellable, GError **mapi_error)
{
- gboolean status;
+ gboolean status, has_obj_folder;
gboolean full_download;
CamelSettings *settings;
CamelStore *store = camel_folder_get_parent_store (folder);
@@ -772,6 +772,7 @@ camel_mapi_folder_fetch_summary (CamelFolder *folder, GCancellable *cancellable,
}
status = cmf_open_folder (mapi_folder, conn, &obj_folder, cancellable, mapi_error);
+ has_obj_folder = status;
if (status) {
status = e_mapi_connection_get_folder_properties (conn, &obj_folder, NULL, NULL, e_mapi_utils_get_folder_basic_properties_cb, &fbp, cancellable, mapi_error);
@@ -849,7 +850,8 @@ camel_mapi_folder_fetch_summary (CamelFolder *folder, GCancellable *cancellable,
camel_folder_change_info_free (gos.changes);
}
- e_mapi_connection_close_folder (conn, &obj_folder, cancellable, mapi_error);
+ if (has_obj_folder)
+ e_mapi_connection_close_folder (conn, &obj_folder, cancellable, mapi_error);
g_slist_free_full (gco.to_update, g_free);
if (gco.removed_uids)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]