feedback-theme: Don't leak json array when serializing profile

json_array_add_element doesn't transfer ownership.
This commit is contained in:
Guido Günther
2023-03-13 15:26:15 +01:00
parent 5206c3aae5
commit 7becab3346
+1 -1
View File
@@ -53,7 +53,7 @@ fbd_theme_serializable_serialize_property (JsonSerializable *serializable,
GHashTableIter iter;
gpointer key;
FbdFeedbackProfile *profile;
JsonArray *array = json_array_sized_new (FBD_FEEDBACK_PROFILE_N_PROFILES);
g_autoptr (JsonArray) array = json_array_sized_new (FBD_FEEDBACK_PROFILE_N_PROFILES);
g_hash_table_iter_init (&iter, self->profiles);
while (g_hash_table_iter_next (&iter, (gpointer *)&key, (gpointer *) &profile)) {