girepository: Fix a memory leak of a mapped file

This was introduced by me in commit
1eec66c8989f418e5254808dc899ae540ba0e89d, 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:
Philip Withnall 2024-01-30 07:45:11 +00:00
parent 5f345a2653
commit d5954664f2

View File

@ -1762,6 +1762,7 @@ require_internal (GIRepository *repository,
bytes = g_mapped_file_get_bytes (mfile);
typelib = gi_typelib_new_from_bytes (bytes, &temp_error);
g_bytes_unref (bytes);
g_clear_pointer (&mfile, g_mapped_file_unref);
if (!typelib)
{