gkeyfile: Tidy up ownership transfer in parse_key_value_pair()

This introduces no functional changes, but does make the ownership
transfer a little clearer.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
Philip Withnall 2021-03-14 14:10:19 +00:00
parent cdcc06bbc5
commit 6c70d30f07

View File

@ -1431,17 +1431,14 @@ g_key_file_parse_key_value_pair (GKeyFile *key_file,
GKeyFileKeyValuePair *pair;
pair = g_slice_new (GKeyFileKeyValuePair);
pair->key = key;
pair->value = value;
pair->key = g_steal_pointer (&key);
pair->value = g_steal_pointer (&value);
g_key_file_add_key_value_pair (key_file, key_file->current_group, pair);
}
else
{
g_free (key);
g_free (value);
}
g_free (locale);
}