shmid value always more than 0.
so, shmctl function return value define and check for memory free.
Change-Id: I4858522e88a3bef834c0c679a88f17528c006566
Signed-off-by: DoHyung Lim <delight.lim@samsung.com>
if (shm->mem != NULL)
shmdt(shm->mem);
shm->mem = NULL;
- if (shm->id > 0)
- shmctl(shm->id, IPC_RMID, 0);
- shm->id = -1;
+ if (shm->id > 0) {
+ int ret_val = shmctl(shm->id, IPC_RMID, 0);
+ if (ret_val != -1) {
+ shm->id = -1;
+ } else {
+ TRACE_ERROR("[ERROR][SHM][%d] shmctl", ret_val);
+ }
+ }
free(shm->local);
shm->local = NULL;
}