mirror of
https://github.com/flatpak/flatpak.git
synced 2026-03-15 21:52:08 -04:00
portal: Fix unset GError issue
Fix lookup_installation_for_path() to not leave the GError pointer unset on its error code path. This error is only used by the caller for a debug message, and shouldn't be hit normally, but it could mean a NULL pointer dereference when we try to print error->message.
This commit is contained in:
committed by
Alexander Larsson
parent
5ce60b5e54
commit
075c86ca4f
@@ -1527,11 +1527,10 @@ lookup_installation_for_path (GFile *path, GError **error)
|
||||
installation = g_hash_table_lookup (installation_cache, path);
|
||||
if (installation == NULL)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(FlatpakDir) dir = NULL;
|
||||
|
||||
dir = flatpak_dir_get_by_path (path);
|
||||
installation = flatpak_installation_new_for_dir (dir, NULL, &error);
|
||||
installation = flatpak_installation_new_for_dir (dir, NULL, error);
|
||||
if (installation == NULL)
|
||||
return NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user