cpu-boosting: Free member of resource_pid_t before exiting by error 08/318308/1
authorUnsung Lee <unsung.lee@samsung.com>
Mon, 13 Jan 2025 06:03:42 +0000 (15:03 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Wed, 15 Jan 2025 08:57:00 +0000 (17:57 +0900)
Free member 'tid' of resource_pid_t before exiting the function by error.

Change-Id: I73067b58bed10af180d3c45b2ed7fc740a3505be
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
src/resource-optimizer/cpu/cpu-boosting.c

index 35891659e2bd4dec9fe948dfbd3e88b5b0428bdb..e5c8b69d31b9727e0eab4bcd98157fb4e0ba191e 100644 (file)
@@ -812,8 +812,10 @@ static int cpu_boosting_enqueue_by_conf(void *data,
                return ret;
 
        *input = cpu_boosting_new_request();
-       if (*input == NULL)
+       if (*input == NULL) {
+               free(pid.tid);
                return RESOURCED_ERROR_FAIL;
+       }
 
        CPU_BOOSTING_SET_REQUEST(*input, CPU_BOOSTING_COMMAND_SET,
                        cpu_boosting_level, -1, pid, 0);