summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoHyung Lim <delight.lim@samsung.com>2017-12-11 13:46:24 +0900
committerHye Kyoung Hwang <cookie@samsung.com>2017-12-14 01:48:24 +0000
commit70a25736a73339626561c4aa466a6a7bf2880f4b (patch)
tree8b288aef607b35d62f952e63c267de29cd1366a0
parent8359e6493b2af71c4081015191fff2da64d9a866 (diff)
downloadbrowser-provider-70a25736a73339626561c4aa466a6a7bf2880f4b.tar.gz
browser-provider-70a25736a73339626561c4aa466a6a7bf2880f4b.tar.bz2
browser-provider-70a25736a73339626561c4aa466a6a7bf2880f4b.zip
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>
-rw-r--r--provider/browser-provider-shm.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/provider/browser-provider-shm.c b/provider/browser-provider-shm.c
index 5919b14..b34a378 100644
--- a/provider/browser-provider-shm.c
+++ b/provider/browser-provider-shm.c
@@ -30,9 +30,14 @@ void bp_shm_free(bp_shm_defs *shm)
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;
}