Add return and null check for preventing invalid memory access
- Issue:
Sometimes, the code may access invalid memory when the function frees
unused memory.
- Solution:
This is because the logic for free Object_Info structure does not check
whether the pointer is not null. There is missing 'return' on 'next'
label, so sometime the code flow can allow freeing members of
Object_Info structure even if the structure still has no memory.
This patch adds missing 'return' expression and null checker for
'object_info'. Through this change, code prevents invalid memory access.
Change-Id: I02d0652f6e3dfb4a8aa6fa0dc25735eac25dc884
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>