From bc5c8e65be484e7f0f1c3ae72d98d0ddf6cba2be Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Thu, 28 Aug 2025 11:15:37 +0200 Subject: [PATCH] dir: Handle NULL sideload state in flatpak_remote_state_lookup_ref Even on success, flatpak_remote_state_resolve_sideloaded_ref might return a NULL FlatpakSideloadState. Handle it properly. --- common/flatpak-dir.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c index 64c6ef6a..2b64ffaa 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -827,12 +827,16 @@ flatpak_remote_state_lookup_ref (FlatpakRemoteState *self, else { FlatpakSideloadState *ss = NULL; + g_autoptr(GFile) found_sideload_path = NULL; if (!flatpak_remote_state_resolve_sideloaded_ref (self, ref, out_checksum, out_timestamp, out_info, &ss, error)) return FALSE; + if (ss) + found_sideload_path = g_object_ref (ostree_repo_get_path (ss->repo)); + if (out_sideload_path) - *out_sideload_path = g_object_ref (ostree_repo_get_path (ss->repo)); + *out_sideload_path = g_steal_pointer (&found_sideload_path); } return TRUE;