From 245725eada9f2a89a4b38b7151bf9e2c29622749 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Thu, 2 Jan 2020 18:39:57 +0100 Subject: [PATCH 162/181] examples: Do not free data returned by g_variant_get_fixed_array This data is owned by the variant, so do not free it. --- examples/storage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/storage.c b/examples/storage.c index bb69305..14a6432 100644 --- a/examples/storage.c +++ b/examples/storage.c @@ -134,7 +134,7 @@ print_data_load (FpDevice *dev, FpFinger finger) g_autoptr(GVariant) val = NULL; g_autoptr(GVariantDict) dict = NULL; - g_autofree guchar *stored_data = NULL; + const guchar *stored_data = NULL; gsize stored_len; dict = load_data (); @@ -145,7 +145,7 @@ print_data_load (FpDevice *dev, FpFinger finger) FpPrint *print; g_autoptr(GError) error = NULL; - stored_data = (guchar *) g_variant_get_fixed_array (val, &stored_len, 1); + stored_data = (const guchar *) g_variant_get_fixed_array (val, &stored_len, 1); print = fp_print_deserialize (stored_data, stored_len, &error); if (error) -- 2.24.1