examples: Do not free data returned by g_variant_get_fixed_array

This data is owned by the variant, so do not free it.
This commit is contained in:
Benjamin Berg 2020-01-02 18:39:57 +01:00
parent 36108f9f82
commit 4db1b84c7a

View file

@ -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)