mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-09-11 13:16:50 +00:00
cleanup: Use non-const pointers for non constant cases
We had various cases in which we were using const pointers for non constant data, and in fact we were allocating and free'ing them. So let's handle all these case properly, so that we won't have newer GLib complaining at us!
This commit is contained in:
@@ -50,9 +50,9 @@ elanmoc_compose_cmd (
|
||||
const struct elanmoc_cmd *cmd_info
|
||||
)
|
||||
{
|
||||
g_autofree char *cmd_buf = NULL;
|
||||
g_autofree uint8_t *cmd_buf = NULL;
|
||||
|
||||
cmd_buf = g_malloc0 (cmd_info->cmd_len);
|
||||
cmd_buf = g_new0 (uint8_t, cmd_info->cmd_len);
|
||||
if(cmd_info->cmd_len < ELAN_MAX_HDR_LEN)
|
||||
memcpy (cmd_buf, &cmd_info->cmd_header, cmd_info->cmd_len);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user