[evolution-patches] Patch for memory leaks : Groupwise backend, calendar and address book
- From: Sushma Rai <rsushma novell com>
- To: Evolution Patches List <evolution-patches lists ximian com>
- Cc: Harish K <KHarish novell com>
- Subject: [evolution-patches] Patch for memory leaks : Groupwise backend, calendar and address book
- Date: Thu, 05 May 2005 12:42:57 +0530
Hi,
Based on the valgrind output during the scalability testing.. fixed
a few issues.
Please review,
-Sushma.
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/ChangeLog,v
retrieving revision 1.254
diff -u -p -r1.254 ChangeLog
--- ChangeLog 4 May 2005 12:59:27 -0000 1.254
+++ ChangeLog 5 May 2005 06:49:24 -0000
@@ -1,3 +1,13 @@
+2005-05-04 Sushma Rai <rsushma novell com>
+
+ * servers/groupwise/e-gw-item.c
+ (set_contact_fields_from_soap_parameter): Freeing value,
+ postal_address.
+ (e_gw_item_new_from_soap_parameter): Freeing "to", priority.
+
+ * servers/groupwise/e-gw-connection.c
+ (e_gw_connection_get_quick_messages): Checking for NULL start date.
+
2005-05-04 Rodrigo Moya <rodrigo novell com>
* configure.in:
Index: servers/groupwise/e-gw-item.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/groupwise/e-gw-item.c,v
retrieving revision 1.77
diff -u -p -r1.77 e-gw-item.c
--- servers/groupwise/e-gw-item.c 26 Apr 2005 12:48:25 -0000 1.77
+++ servers/groupwise/e-gw-item.c 5 May 2005 06:50:03 -0000
@@ -1023,6 +1023,8 @@ set_contact_fields_from_soap_parameter (
value = soup_soap_parameter_get_string_value (temp);
if (value && (!primary_email || !g_str_equal (primary_email, value)))
item->priv->email_list = g_list_append (item->priv->email_list, value);
+ else
+ g_free (value);
}
g_free (primary_email);
}
@@ -1117,8 +1119,8 @@ set_contact_fields_from_soap_parameter (
value = soup_soap_parameter_get_property(temp, "type");
if (value)
g_hash_table_insert (item->priv->addresses, value, address);
-
-
+ else
+ free_postal_address (address);
}
}
@@ -1730,8 +1732,8 @@ e_gw_item_new_from_soap_parameter (const
} else if (!g_ascii_strcasecmp (name, "to")) {
char *to ;
to = soup_soap_parameter_get_string_value (child) ;
- e_gw_item_set_to (item,to) ;
-
+ e_gw_item_set_to (item, to);
+ g_free (to);
} else if (!g_ascii_strcasecmp (name, "iCalId"))
item->priv->icalid = soup_soap_parameter_get_string_value (child);
@@ -1814,7 +1816,11 @@ e_gw_item_new_from_soap_parameter (const
item->priv->place = soup_soap_parameter_get_string_value (child);
else if (!g_ascii_strcasecmp (name, "taskPriority")) {
- e_gw_item_set_task_priority (item, soup_soap_parameter_get_string_value (child));
+ char *priority;
+
+ priority = soup_soap_parameter_get_string_value (child);
+ e_gw_item_set_task_priority (item, priority);
+ g_free (priority);
}
else if (!g_ascii_strcasecmp (name, "startDate")) {
Index: servers/groupwise/e-gw-connection.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/groupwise/e-gw-connection.c,v
retrieving revision 1.113
diff -u -p -r1.113 e-gw-connection.c
--- servers/groupwise/e-gw-connection.c 7 Apr 2005 15:49:59 -0000 1.113
+++ servers/groupwise/e-gw-connection.c 5 May 2005 06:50:15 -0000
@@ -2132,7 +2132,7 @@ EGwConnectionStatus e_gw_connection_get_
msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "getQuickMessagesRequest");
e_gw_message_write_string_parameter (msg, "list", NULL, message_list);
- if (start_date)
+ if (start_date && *start_date)
e_gw_message_write_string_parameter (msg, "startDate", NULL, *start_date);
if (container)
e_gw_message_write_string_parameter (msg, "container", NULL, container);
Index: addressbook/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/addressbook/ChangeLog,v
retrieving revision 1.265
diff -u -p -r1.265 ChangeLog
--- addressbook/ChangeLog 4 May 2005 08:46:11 -0000 1.265
+++ addressbook/ChangeLog 5 May 2005 06:50:33 -0000
@@ -1,3 +1,8 @@
+2005-05-04 Sushma Rai <rsushma novell com>
+
+ * libedata-book/e-book-backend-cache.c
+ (e_book_backend_cache_constructor): Freeing cache file name.
+
2005-05-04 Hans Petter Jansson <hpj novell com>
* libebook/e-address-western.c:
Index: addressbook/libedata-book/e-book-backend-cache.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/addressbook/libedata-book/e-book-backend-cache.c,v
retrieving revision 1.3
diff -u -p -r1.3 e-book-backend-cache.c
--- addressbook/libedata-book/e-book-backend-cache.c 10 Jan 2005 11:52:03 -0000 1.3
+++ addressbook/libedata-book/e-book-backend-cache.c 5 May 2005 06:50:55 -0000
@@ -142,6 +142,7 @@ e_book_backend_cache_constructor (GType
{
GObject *obj;
const char *uri;
+ char *cache_file;
EBookBackendCacheClass *klass;
GObjectClass *parent_class;
@@ -155,7 +156,10 @@ e_book_backend_cache_constructor (GType
/* extract uid */
if (!g_ascii_strcasecmp ( g_param_spec_get_name (construct_properties->pspec), "uri")) {
uri = g_value_get_string (construct_properties->value);
- g_object_set (obj, "filename", get_filename_from_uri (uri), NULL);
+ cache_file = get_filename_from_uri (uri);
+ if (cache_file)
+ g_object_set (obj, "filename", cache_file, NULL);
+ g_free (cache_file);
}
return obj;
Index: calendar/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/ChangeLog,v
retrieving revision 1.453
diff -u -p -r1.453 ChangeLog
--- calendar/ChangeLog 4 May 2005 06:44:36 -0000 1.453
+++ calendar/ChangeLog 5 May 2005 06:51:18 -0000
@@ -1,3 +1,15 @@
+2005-05-04 Sushma Rai <rsushma novell com>
+
+ * libedata-cal/e-cal-backend-cache.c (e_cal_backend_cache_constructor):
+ Freeing cache file name.
+
+ * calendar/backends/groupwise/e-cal-backend-groupwise.c (get_deltas):
+ Checking for server time value, though typically this should never be NULL.
+ (e_cal_backend_groupwise_get_object_list): Unref cbsexp.
+
+ * calendar/backends/file/e-cal-backend-file.c
+ (e_cal_backend_file_get_object_list)(create_user_free_busy): Unref sexp.
+
2005-05-04 Rodrigo Moya <rodrigo novell com>
Fixes #300920
Index: calendar/libedata-cal/e-cal-backend-cache.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/libedata-cal/e-cal-backend-cache.c,v
retrieving revision 1.20
diff -u -p -r1.20 e-cal-backend-cache.c
--- calendar/libedata-cal/e-cal-backend-cache.c 25 Feb 2005 06:36:51 -0000 1.20
+++ calendar/libedata-cal/e-cal-backend-cache.c 5 May 2005 06:59:52 -0000
@@ -166,8 +166,12 @@ e_cal_backend_cache_constructor (GType t
/* extract uid */
if (!g_ascii_strcasecmp ( g_param_spec_get_name (construct_properties->pspec), "uri")) {
+ char *cache_file;
+
uri = g_value_get_string (construct_properties->value);
- g_object_set (obj, "filename", get_filename_from_uri (uri), NULL);
+ cache_file = get_filename_from_uri (uri);
+ g_object_set (obj, "filename", cache_file, NULL);
+ g_free (cache_file);
}
return obj;
Index: calendar/backends/groupwise/e-cal-backend-groupwise.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/backends/groupwise/e-cal-backend-groupwise.c,v
retrieving revision 1.143
diff -u -p -r1.143 e-cal-backend-groupwise.c
--- calendar/backends/groupwise/e-cal-backend-groupwise.c 18 Apr 2005 13:46:53 -0000 1.143
+++ calendar/backends/groupwise/e-cal-backend-groupwise.c 5 May 2005 07:00:22 -0000
@@ -196,6 +196,7 @@ get_deltas (gpointer handle)
char *comp_str;
char *time_string = NULL;
char t_str [100];
+ const char *serv_time;
struct stat buf;
static GStaticMutex connecting = G_STATIC_MUTEX_INIT;
@@ -213,20 +214,23 @@ get_deltas (gpointer handle)
g_static_mutex_lock (&connecting);
- g_strlcpy (t_str, e_cal_backend_cache_get_server_utc_time (cache), 100);
- if (!*t_str || !strcmp (t_str, "")) {
- icaltimetype temp;
- time_t current_time;
- const struct tm *tm;
-
- g_warning (" Could not get the correct time stamp for using in getQuick Messages\n");
- temp = icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ());
- current_time = icaltime_as_timet_with_zone (temp, icaltimezone_get_utc_timezone ());
- tm = gmtime (¤t_time);
- strftime (t_str, 100, "%Y-%m-%dT%H:%M:%SZ", tm);
+ serv_time = e_cal_backend_cache_get_server_utc_time (cache);
+ if (serv_time) {
+ g_strlcpy (t_str, e_cal_backend_cache_get_server_utc_time (cache), 100);
+ if (!*t_str || !strcmp (t_str, "")) {
+ icaltimetype temp;
+ time_t current_time;
+ const struct tm *tm;
+
+ g_warning (" Could not get the correct time stamp for using in getQuick Messages\n");
+ temp = icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ());
+ current_time = icaltime_as_timet_with_zone (temp, icaltimezone_get_utc_timezone ());
+ tm = gmtime (¤t_time);
+ strftime (t_str, 100, "%Y-%m-%dT%H:%M:%SZ", tm);
+ }
+ time_string = g_strdup (t_str);
}
- time_string = g_strdup (t_str);
status = e_gw_connection_get_quick_messages (cnc, cbgw->priv->container_id, "attachments recipients message recipientStatus default peek", &time_string, "New", "CalendarItem", NULL, -1, &item_list);
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
@@ -1169,6 +1173,7 @@ e_cal_backend_groupwise_get_object_list
}
}
+ g_object_unref (cbsexp);
g_list_foreach (components, (GFunc) g_object_unref, NULL);
g_list_free (components);
Index: calendar/backends/file/e-cal-backend-file.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/backends/file/e-cal-backend-file.c,v
retrieving revision 1.53
diff -u -p -r1.53 e-cal-backend-file.c
--- calendar/backends/file/e-cal-backend-file.c 24 Feb 2005 10:58:57 -0000 1.53
+++ calendar/backends/file/e-cal-backend-file.c 5 May 2005 07:00:42 -0000
@@ -1252,6 +1252,8 @@ e_cal_backend_file_get_object_list (ECal
g_hash_table_foreach (priv->comp_uid_hash, (GHFunc) match_object_sexp, &match_data);
*objects = match_data.obj_list;
+
+ g_object_unref (match_data.obj_sexp);
return GNOME_Evolution_Calendar_Success;
}
@@ -1295,6 +1297,7 @@ e_cal_backend_file_start_query (ECalBack
g_list_foreach (match_data.obj_list, (GFunc) g_free, NULL);
g_list_free (match_data.obj_list);
}
+ g_object_unref (match_data.obj_sexp);
e_data_cal_view_notify_done (query, GNOME_Evolution_Calendar_Success);
}
@@ -1403,6 +1406,7 @@ create_user_free_busy (ECalBackendFile *
vcalendar_comp,
priv->default_zone);
}
+ g_object_unref (obj_sexp);
return vfb;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]