mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-11 03:46:17 +01:00
GKeyfile: don't leak on failed get_(u)int64
In the case that g_key_file_get_(u)int64 fails to parse the integer, make sure we free the string before returning. Reported by Andrew Stone <astonecc@gmail.com> https://bugzilla.gnome.org/show_bug.cgi?id=710313
This commit is contained in:
parent
efecfe0fac
commit
1b592524ff
@ -2614,6 +2614,7 @@ g_key_file_get_int64 (GKeyFile *key_file,
|
||||
_("Key '%s' in group '%s' has value '%s' "
|
||||
"where %s was expected"),
|
||||
key, group_name, s, "int64");
|
||||
g_free (s);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2690,6 +2691,7 @@ g_key_file_get_uint64 (GKeyFile *key_file,
|
||||
_("Key '%s' in group '%s' has value '%s' "
|
||||
"where %s was expected"),
|
||||
key, group_name, s, "uint64");
|
||||
g_free (s);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user