mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-16 01:06:15 +01:00
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:
parent
cdcc06bbc5
commit
6c70d30f07
@ -1431,17 +1431,14 @@ g_key_file_parse_key_value_pair (GKeyFile *key_file,
|
|||||||
GKeyFileKeyValuePair *pair;
|
GKeyFileKeyValuePair *pair;
|
||||||
|
|
||||||
pair = g_slice_new (GKeyFileKeyValuePair);
|
pair = g_slice_new (GKeyFileKeyValuePair);
|
||||||
pair->key = key;
|
pair->key = g_steal_pointer (&key);
|
||||||
pair->value = value;
|
pair->value = g_steal_pointer (&value);
|
||||||
|
|
||||||
g_key_file_add_key_value_pair (key_file, key_file->current_group, pair);
|
g_key_file_add_key_value_pair (key_file, key_file->current_group, pair);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
g_free (key);
|
g_free (key);
|
||||||
g_free (value);
|
g_free (value);
|
||||||
}
|
|
||||||
|
|
||||||
g_free (locale);
|
g_free (locale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user