Fix memory size of dest_process 90/280390/1 accepted/tizen/unified/20220902.020126 submit/tizen/20220901.095920
authorUnsung Lee <unsung.lee@samsung.com>
Mon, 29 Aug 2022 10:17:36 +0000 (19:17 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Mon, 29 Aug 2022 10:22:17 +0000 (19:22 +0900)
Change-Id: Ibc27ad11c958ae000391381d6c90ed00106bb36f
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
src/resource-optimizer/cpu/cpu-boosting.c

index 2f26ca0..fa6ec8d 100644 (file)
@@ -395,7 +395,7 @@ static int cpu_boosting_enqueue_by_socket(int sock, struct cpu_boosting_input **
                        goto destroy_input;
                }
 
-               dest = (char *)calloc(input->client_input.dest_len, sizeof(char));
+               dest = (char *)calloc(input->client_input.dest_len + 1, sizeof(char));
                if (dest == NULL) {
                        _E("[CPU-BOOSTING] Failed to allocate memory");
                        ret = RESOURCED_ERROR_OUT_OF_MEMORY;