feedback-profile: 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:10 +01:00
parent 1933a23172
commit 5206c3aae5
+1 -1
View File
@@ -58,7 +58,7 @@ fbd_feedback_profile_serializable_serialize_property (JsonSerializable *serializ
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->feedbacks);
while (g_hash_table_iter_next (&iter, (gpointer *)&key, (gpointer *) &profile)) {