mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-21 08:28:53 +02:00
girepository: Fix a memory leak of a mapped file
This was introduced by me in commit
1eec66c898
, as the ownership transfer
semantics of `gi_typelib_new_from_mapped_file()` were not blatant.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3237
This commit is contained in:
@@ -1762,6 +1762,7 @@ require_internal (GIRepository *repository,
|
|||||||
bytes = g_mapped_file_get_bytes (mfile);
|
bytes = g_mapped_file_get_bytes (mfile);
|
||||||
typelib = gi_typelib_new_from_bytes (bytes, &temp_error);
|
typelib = gi_typelib_new_from_bytes (bytes, &temp_error);
|
||||||
g_bytes_unref (bytes);
|
g_bytes_unref (bytes);
|
||||||
|
g_clear_pointer (&mfile, g_mapped_file_unref);
|
||||||
|
|
||||||
if (!typelib)
|
if (!typelib)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user