From 4784f58ff0ecffb4781e161574a67e26a674cbf0 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 20 Aug 2025 16:15:46 +0200 Subject: [PATCH] input: Fix incorrect destructors being used g_key_file_get_string() expects its value to be freed with g_free(), not free(). Fixes: profiles/input/manager.c:118:2: leaked_storage: Variable "uhid_enabled" going out of scope leaks the storage it points to. profiles/input/hog.c:267:1: leaked_storage: Variable "uhid_enabled" going out of scope leaks the storage it points to. --- profiles/input/hog.c | 2 +- profiles/input/manager.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/profiles/input/hog.c b/profiles/input/hog.c index f5d24aad6..1f5b82b77 100644 --- a/profiles/input/hog.c +++ b/profiles/input/hog.c @@ -259,7 +259,7 @@ static void hog_read_config(void) if (!err) { DBG("input.conf: UserspaceHID=%s", uhid_enabled); uhid_state_persist = strcasecmp(uhid_enabled, "persist") == 0; - free(uhid_enabled); + g_free(uhid_enabled); } else g_clear_error(&err); diff --git a/profiles/input/manager.c b/profiles/input/manager.c index d0db13f2d..b0e415f67 100644 --- a/profiles/input/manager.c +++ b/profiles/input/manager.c @@ -101,7 +101,7 @@ static int input_init(void) if (!err) { DBG("input.conf: UserspaceHID=%s", uhid_enabled); input_set_userspace_hid(uhid_enabled); - free(uhid_enabled); + g_free(uhid_enabled); } else g_clear_error(&err); -- 2.47.3