[evolution] Memory leaks around g_value_set_string
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Memory leaks around g_value_set_string
- Date: Fri, 22 Oct 2010 13:44:20 +0000 (UTC)
commit f0714755e2fa8b06425907c2cf189abd3a1b7119
Author: Milan Crha <mcrha redhat com>
Date: Fri Oct 22 15:42:21 2010 +0200
Memory leaks around g_value_set_string
calendar/gui/e-alarm-list.c | 5 +++--
widgets/table/e-table-click-to-add.c | 2 +-
widgets/table/e-table-field-chooser-dialog.c | 2 +-
widgets/text/e-text.c | 6 +++---
4 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/calendar/gui/e-alarm-list.c b/calendar/gui/e-alarm-list.c
index 2e6a12e..48b55bb 100644
--- a/calendar/gui/e-alarm-list.c
+++ b/calendar/gui/e-alarm-list.c
@@ -556,7 +556,7 @@ e_alarm_list_get_value (GtkTreeModel *tree_model,
EAlarmList *alarm_list = E_ALARM_LIST (tree_model);
ECalComponentAlarm *alarm;
GList *l;
- const gchar *str;
+ gchar *str;
g_return_if_fail (E_IS_ALARM_LIST (tree_model));
g_return_if_fail (column < E_ALARM_LIST_NUM_COLUMNS);
@@ -568,7 +568,7 @@ e_alarm_list_get_value (GtkTreeModel *tree_model,
if (!alarm_list->list)
return;
- l = iter->user_data;
+ l = iter->user_data;
alarm = l->data;
if (!alarm)
@@ -578,6 +578,7 @@ e_alarm_list_get_value (GtkTreeModel *tree_model,
case E_ALARM_LIST_COLUMN_DESCRIPTION:
str = get_alarm_string (alarm);
g_value_set_string (value, str);
+ g_free (str);
break;
}
}
diff --git a/widgets/table/e-table-click-to-add.c b/widgets/table/e-table-click-to-add.c
index 706146f..8f46620 100644
--- a/widgets/table/e-table-click-to-add.c
+++ b/widgets/table/e-table-click-to-add.c
@@ -288,7 +288,7 @@ etcta_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *p
g_value_set_object (value, etcta->model);
break;
case PROP_MESSAGE:
- g_value_set_string (value, g_strdup (etcta->message));
+ g_value_set_string (value, etcta->message);
break;
case PROP_WIDTH:
g_value_set_double (value, etcta->width);
diff --git a/widgets/table/e-table-field-chooser-dialog.c b/widgets/table/e-table-field-chooser-dialog.c
index 440446e..a4e96ec 100644
--- a/widgets/table/e-table-field-chooser-dialog.c
+++ b/widgets/table/e-table-field-chooser-dialog.c
@@ -196,7 +196,7 @@ e_table_field_chooser_dialog_get_property (GObject *object, guint prop_id, GValu
ETableFieldChooserDialog *etfcd = E_TABLE_FIELD_CHOOSER_DIALOG (object);
switch (prop_id) {
case PROP_DND_CODE:
- g_value_set_string (value, g_strdup (etfcd->dnd_code));
+ g_value_set_string (value, etfcd->dnd_code);
break;
case PROP_FULL_HEADER:
g_value_set_object (value, etfcd->full_header);
diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c
index 2ea35ed..90eb4d0 100644
--- a/widgets/text/e-text.c
+++ b/widgets/text/e-text.c
@@ -1058,7 +1058,7 @@ e_text_get_property (GObject *object,
break;
case PROP_TEXT:
- g_value_set_string (value, g_strdup (text->text));
+ g_value_set_string (value, text->text);
break;
case PROP_BOLD:
@@ -1130,7 +1130,7 @@ e_text_get_property (GObject *object,
break;
case PROP_ELLIPSIS:
- g_value_set_string (value, g_strdup (text->ellipsis));
+ g_value_set_string (value, text->ellipsis);
break;
case PROP_LINE_WRAP:
@@ -1138,7 +1138,7 @@ e_text_get_property (GObject *object,
break;
case PROP_BREAK_CHARACTERS:
- g_value_set_string (value, g_strdup (text->break_characters));
+ g_value_set_string (value, text->break_characters);
break;
case PROP_MAX_LINES:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]