From 663302543741677b39f1d8353086df223dbd43f8 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Fri, 29 May 2020 17:54:29 +0200 Subject: [PATCH] vfs301: Allow freeing of data by copying it When sending static data, it would not be copied. The function that sends it assumed that it should be free'ed though. Fix this by simply always making a copy. --- libfprint/drivers/vfs301_proto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libfprint/drivers/vfs301_proto.c b/libfprint/drivers/vfs301_proto.c index c272659..bcd09e9 100644 --- a/libfprint/drivers/vfs301_proto.c +++ b/libfprint/drivers/vfs301_proto.c @@ -438,7 +438,7 @@ img_process_data (int first_block, FpDeviceVfs301 *dev, const guint8 *buf, int l usb_send (dev, data, len, NULL); \ } -#define RAW_DATA(x) x, sizeof (x) +#define RAW_DATA(x) g_memdup (x, sizeof (x)), sizeof (x) #define IS_VFS301_FP_SEQ_START(b) ((b[0] == 0x01) && (b[1] == 0xfe))