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:
Ryan Lortie 2013-10-22 16:24:41 -04:00
parent efecfe0fac
commit 1b592524ff

View File

@ -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;
}