[mutter/wip/carlosg/coverity-fixes: 4/8] cogl: Plug possible GString leaks
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/coverity-fixes: 4/8] cogl: Plug possible GString leaks
- Date: Mon, 25 Oct 2021 12:03:02 +0000 (UTC)
commit 59b35ee149e1ef126bc7113f24d7e14c3676afb6
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Oct 24 23:16:22 2021 +0200
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
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 7555257d09..9f1007b942 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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]