mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-23 12:41:50 +01:00
gio/module: fix leak when there is no cache
GIOModule is a helper object, we keep it around when there is a cache, but we should free it otherwise. Found thanks to ASAN. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
parent
60b8916fee
commit
ad0fd6c5d9
@ -581,12 +581,8 @@ g_io_modules_scan_all_in_directory_with_scope (const char *dirname,
|
|||||||
if (g_type_module_use (G_TYPE_MODULE (module)))
|
if (g_type_module_use (G_TYPE_MODULE (module)))
|
||||||
g_type_module_unuse (G_TYPE_MODULE (module)); /* Unload */
|
g_type_module_unuse (G_TYPE_MODULE (module)); /* Unload */
|
||||||
else
|
else
|
||||||
{ /* Failure to load */
|
|
||||||
g_printerr ("Failed to load module: %s\n", path);
|
g_printerr ("Failed to load module: %s\n", path);
|
||||||
g_object_unref (module);
|
g_object_unref (module);
|
||||||
g_free (path);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free (path);
|
g_free (path);
|
||||||
|
Loading…
Reference in New Issue
Block a user