libpurple/purpleaccountoption.c

changeset 40329
b5e0f65a5d9c
parent 40195
fb4b0ae193c0
child 40331
684befe3ae5d
--- a/libpurple/purpleaccountoption.c	Tue Nov 26 23:59:35 2019 +0300
+++ b/libpurple/purpleaccountoption.c	Wed Nov 27 00:08:11 2019 +0300
@@ -185,7 +185,7 @@
 	else if (option->type == PURPLE_PREF_STRING_LIST)
 	{
 		g_list_free_full(option->default_value.list,
-		                 (GDestroyNotify)purple_key_value_pair_free);
+				 (GDestroyNotify)purple_key_value_pair_free_full);
 	}
 
 	g_free(option);
@@ -247,7 +247,7 @@
 	g_return_if_fail(option->type == PURPLE_PREF_STRING_LIST);
 
 	g_list_free_full(option->default_value.list,
-	                 (GDestroyNotify)purple_key_value_pair_free);
+			 (GDestroyNotify)purple_key_value_pair_free_full);
 
 	option->default_value.list = values;
 }
@@ -263,9 +263,7 @@
 	g_return_if_fail(value  != NULL);
 	g_return_if_fail(option->type == PURPLE_PREF_STRING_LIST);
 
-	kvp = g_new0(PurpleKeyValuePair, 1);
-	kvp->key = g_strdup(key);
-	kvp->value = g_strdup(value);
+	kvp = purple_key_value_pair_new(key, g_strdup(value));
 
 	option->default_value.list = g_list_append(option->default_value.list,
 											   kvp);

mercurial