/pidgin/main: 277c5fda03fe: Fix plugin pref choice labels to be ...
Daniel Atallah
datallah at pidgin.im
Wed Nov 5 01:06:13 EST 2014
Changeset: 277c5fda03fef2c2b2268384516dad5ec1a29573
Author: Daniel Atallah <datallah at pidgin.im>
Date: 2014-11-05 00:59 -0500
Branch: release-2.x.y
URL: https://hg.pidgin.im/pidgin/main/rev/277c5fda03fe
Description:
Fix plugin pref choice labels to be dynamically allocated.
diffstat:
libpurple/pluginpref.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diffs (32 lines):
diff --git a/libpurple/pluginpref.c b/libpurple/pluginpref.c
--- a/libpurple/pluginpref.c
+++ b/libpurple/pluginpref.c
@@ -142,10 +142,19 @@ purple_plugin_pref_new_with_name_and_lab
void
purple_plugin_pref_destroy(PurplePluginPref *pref)
{
+ GList *tmp;
g_return_if_fail(pref != NULL);
g_free(pref->name);
g_free(pref->label);
+ tmp = pref->choices;
+ while(tmp) {
+ g_free(tmp->data);
+ /* Remove the string, and the data entries */
+ tmp = g_list_delete_link(tmp, tmp);
+ tmp = g_list_delete_link(tmp, tmp);
+ }
+
g_list_free(pref->choices);
g_free(pref);
}
@@ -253,7 +262,7 @@ purple_plugin_pref_add_choice(PurplePlug
g_return_if_fail(label != NULL);
g_return_if_fail(choice || purple_prefs_get_type(pref->name) == PURPLE_PREF_INT);
- pref->choices = g_list_append(pref->choices, (gpointer)label);
+ pref->choices = g_list_append(pref->choices, g_strdup(label));
pref->choices = g_list_append(pref->choices, choice);
}
More information about the Commits
mailing list