From ed9650ff424c9195aac728502dad5fff2cecf6e5 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Sun, 24 Oct 2021 23:16:22 +0200 Subject: [PATCH] cogl: Plug possible GString leaks These strings are leaked if there are no changes to log. This is perhaps never true, but this anyway good for clarity. CIDs: #1505840, #1505884 Part-of: --- cogl/cogl/cogl-pipeline-debug.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cogl/cogl/cogl-pipeline-debug.c b/cogl/cogl/cogl-pipeline-debug.c index 7555257d0..9f1007b94 100644 --- a/cogl/cogl/cogl-pipeline-debug.c +++ b/cogl/cogl/cogl-pipeline-debug.c @@ -103,9 +103,10 @@ dump_layer_cb (CoglNode *node, void *user_data) { g_string_append_printf (changes_label, "\"];\n"); g_string_append (state->graph, changes_label->str); - g_string_free (changes_label, TRUE); } + g_string_free (changes_label, TRUE); + state_out.parent_id = layer_id; state_out.node_id_ptr = state->node_id_ptr; @@ -210,9 +211,10 @@ dump_pipeline_cb (CoglNode *node, void *user_data) { g_string_append_printf (changes_label, "\"];\n"); g_string_append (state->graph, changes_label->str); - g_string_free (changes_label, TRUE); } + g_string_free (changes_label, TRUE); + if (layers) { g_list_foreach (pipeline->layer_differences,