From: Colin Walters Date: Fri, 9 Feb 2024 00:34:54 +0000 (-0500) Subject: prepare-root: Fix crash if no keys were found X-Git-Tag: archive/raspbian/2024.8-1+rpi1^2~7^2~5^2~8^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=95f4bb6dfe75aa17ae7aeec521663f8acf9d11a7;p=ostree.git prepare-root: Fix crash if no keys were found Handle a NULL pointer. --- diff --git a/src/libotcore/otcore-prepare-root.c b/src/libotcore/otcore-prepare-root.c index 12a85c08..42f92c91 100644 --- a/src/libotcore/otcore-prepare-root.c +++ b/src/libotcore/otcore-prepare-root.c @@ -147,7 +147,7 @@ otcore_load_config (int rootfs_fd, const char *filename, GError **error) void otcore_free_composefs_config (ComposefsConfig *config) { - g_ptr_array_unref (config->pubkeys); + g_clear_pointer (&config->pubkeys, g_ptr_array_unref); g_free (config->signature_pubkey); g_free (config); }