From 16ad1e428f830a4aa3e434d27be1cb544206d83a Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 13 Aug 2024 20:50:50 -0400 Subject: [PATCH] colorstate: Don't leak names The cicp colorstates allocate their names, so they should free them too. --- gdk/gdkcolorstate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gdk/gdkcolorstate.c b/gdk/gdkcolorstate.c index 7993d3de4c..3b061464e2 100644 --- a/gdk/gdkcolorstate.c +++ b/gdk/gdkcolorstate.c @@ -425,7 +425,7 @@ struct _GdkCicpColorState GdkColorState *no_srgb; - const char *name; + char *name; GdkTransferFunc eotf; GdkTransferFunc oetf; @@ -461,6 +461,8 @@ gdk_cicp_color_state_free (GdkColorState *cs) { GdkCicpColorState *self = (GdkCicpColorState *) cs; + g_free (self->name); + if (self->no_srgb) gdk_color_state_unref (self->no_srgb);