From 4892ea6d76d235ab4402f740a189621afb4eb99f Mon Sep 17 00:00:00 2001 From: Jongkyu Koo Date: Fri, 16 Dec 2016 17:12:02 +0900 Subject: [PATCH] check return value of strdup() Change-Id: I7b9b8644c9641abb3d4ed4ed0b2565b11aae4d9f Signed-off-by: Jongkyu Koo --- common/ipc/ctsvc_ipc_marshal.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/common/ipc/ctsvc_ipc_marshal.c b/common/ipc/ctsvc_ipc_marshal.c index 45c309a..fda5259 100644 --- a/common/ipc/ctsvc_ipc_marshal.c +++ b/common/ipc/ctsvc_ipc_marshal.c @@ -522,9 +522,13 @@ int ctsvc_ipc_unmarshal_string(const pims_ipc_data_h ipc_data, char **ppbufchar) } str = (char*)pims_ipc_data_get(ipc_data, &size); - if (str) - *ppbufchar = SAFE_STRDUP(str); - + if (str) { + *ppbufchar = strdup(str); + if (NULL == *ppbufchar) { + ERR("strdup() Fail"); + return CONTACTS_ERROR_SYSTEM; + } + } return ret; } -- 2.7.4