Use setter to set invocation name safely 81/283781/1
authorSuyeon Hwang <stom.hwang@samsung.com>
Fri, 28 Oct 2022 06:24:43 +0000 (15:24 +0900)
committerTizen AI <ai.tzn.sec@samsung.com>
Thu, 3 Nov 2022 01:47:52 +0000 (10:47 +0900)
commitc6b7badd297ef6e2b674fce8e8ac0af8b3f1107e
tree86b6ea30eeda56abd150badc6cc39998262f23ea
parentf0a2a9a35265b37a9e02e9c6363d63fcf4fac40b
Use setter to set invocation name safely

- Issue:
The invocation name previously set can be leaked.

- Solution:
The invocation name parameter is set by __vc_db_insert_commands_list()
without checking invocation itself. In most cases, invocation name is
not set by this function, but in special cases, memory leak can
occurred if use repeatedely set command list.
Thus, this patch prevents leak using setter function. The setter
function checks the invocation name paraemeter and safely changes it.

Change-Id: Ibe373fd51d5c2880ccea1d2b6699cd5614ffe49c
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
common/vc_cmd_db.c