Skip to content
Snippets Groups Projects
Commit 31323c35 authored by Olivier Fourdan's avatar Olivier Fourdan :tools: Committed by Olivier Fourdan
Browse files

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: default avatarOlivier Fourdan <fourdan@xfce.org>
Closes: #406
(cherry picked from commit 056ba6ad)
parent 124dfe47
No related branches found
No related tags found
1 merge request!6Backports fixes from master
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment