summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhaedrus Leeds <matthew.leeds@endlessm.com>2020-09-14 09:53:51 -0700
committerPhaedrus Leeds <matthew.leeds@endlessm.com>2020-09-14 09:53:51 -0700
commita4e36890b09e0cbdd7685cf5fbe88ff4222b61bc (patch)
tree40a4c5006b782b28c18dd8159a7507ae4da6ba17
parent5ce60b5e54f95e8be6a634da2d75d799fee93cad (diff)
downloadflatpak-portal-errors-fix.tar.gz
portal: Fix unset GError issueportal-errors-fix
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.
-rw-r--r--portal/flatpak-portal.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/portal/flatpak-portal.c b/portal/flatpak-portal.c
index e2b1658b..274f1f45 100644
--- a/portal/flatpak-portal.c
+++ b/portal/flatpak-portal.c
@@ -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;