From 056ba6adbf44ded5b4f51338ef3a14cecdbde213 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Wed, 15 Jul 2020 16:14:48 +0200 Subject: [PATCH] settings: Duplicate string gvalues The gvalues strings were considered statics, hence not duplicated. As the caller frees the strings after setting the gvalue, the actual content would end up pointing at free data. Consider string gvalues as regular strings, meaning that the given string value is duplicated as a gvalue. Signed-off-by: Olivier Fourdan Closes: https://gitlab.xfce.org/xfce/xfwm4/-/issues/406 --- src/parserc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parserc.c b/src/parserc.c index e271ebb63..ffd5a2b43 100644 --- a/src/parserc.c +++ b/src/parserc.c @@ -211,7 +211,7 @@ setStringValue (const gchar * lvalue, const gchar *value, Settings *rc) { GValue tmp_val = {0, }; g_value_init(&tmp_val, G_TYPE_STRING); - g_value_set_static_string(&tmp_val, value); + g_value_set_string(&tmp_val, value); return setGValue (lvalue, &tmp_val, rc); } -- GitLab