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:
parent
36108f9f82
commit
4db1b84c7a
1 changed files with 2 additions and 2 deletions
|
@ -134,7 +134,7 @@ print_data_load (FpDevice *dev, FpFinger finger)
|
||||||
|
|
||||||
g_autoptr(GVariant) val = NULL;
|
g_autoptr(GVariant) val = NULL;
|
||||||
g_autoptr(GVariantDict) dict = NULL;
|
g_autoptr(GVariantDict) dict = NULL;
|
||||||
g_autofree guchar *stored_data = NULL;
|
const guchar *stored_data = NULL;
|
||||||
gsize stored_len;
|
gsize stored_len;
|
||||||
|
|
||||||
dict = load_data ();
|
dict = load_data ();
|
||||||
|
@ -145,7 +145,7 @@ print_data_load (FpDevice *dev, FpFinger finger)
|
||||||
FpPrint *print;
|
FpPrint *print;
|
||||||
g_autoptr(GError) error = NULL;
|
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);
|
print = fp_print_deserialize (stored_data, stored_len, &error);
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
|
|
Loading…
Reference in a new issue