From: Joohyun Kim Date: Thu, 4 Jul 2013 08:04:56 +0000 (+0900) Subject: Fix memory leak on imei X-Git-Tag: submit/tizen_2.2/20130714.152805~24^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c694eba8d97ec20c501170b50023ed9bed533e95;p=framework%2Fosp%2Fappfw.git Fix memory leak on imei Change-Id: Idc61de67d2a7578c860df39579d1eeb648e7d464 Signed-off-by: Joohyun Kim --- diff --git a/src/system/FSys_SystemInfoImpl.cpp b/src/system/FSys_SystemInfoImpl.cpp index b7883c2..a0e1e20 100644 --- a/src/system/FSys_SystemInfoImpl.cpp +++ b/src/system/FSys_SystemInfoImpl.cpp @@ -826,16 +826,20 @@ _SystemInfoImpl::GetImei(String& imei) r = pIpcClient->SendRequest(pMsg.get()); SysTryReturn(NID_SYS, r == E_SUCCESS, E_SYSTEM, r, "It is failed to send ipc message. [%s]", GetErrorMessage(r)); - unique_ptr pResult((String*)responseMessage.GetAt(_SYSTEM_RESPONSE_DATA)); - unique_ptr pImei((String*)responseMessage.GetAt(_SYSTEM_RESPONSE_DATA+1)); + String* pResult = (String*)responseMessage.GetAt(_SYSTEM_RESPONSE_DATA); + String* pImei = (String*)responseMessage.GetAt(_SYSTEM_RESPONSE_DATA+1); - SysTryReturnResult(NID_SYS, pResult != null, E_SYSTEM, "It is failed to receive result on IPC response message."); - SysTryReturnResult(NID_SYS, pImei != null, E_SYSTEM, "It is failed to receive IMEI value on IPC response message."); + SysTryReturn(NID_SYS, pResult != null, r = E_SYSTEM, r, "It is failed to receive result on IPC response message."); + SysTryReturn(NID_SYS, pImei != null, r = E_SYSTEM, r, "It is failed to receive IMEI value on IPC response message."); - SysTryReturnResult(NID_SYS, *pResult != _SYSTEM_RESULT_PRIVILEGED, E_PRIVILEGE_DENIED, "It is failed to get privilege."); - SysTryReturnResult(NID_SYS, *pResult == _SYSTEM_RESULT_OK, E_SYSTEM, "It is failed to get IMEI value."); + SysTryReturn(NID_SYS, *pResult != _SYSTEM_RESULT_PRIVILEGED, r = E_PRIVILEGE_DENIED, r, "It is failed to get privilege."); + SysTryReturn(NID_SYS, *pResult == _SYSTEM_RESULT_OK, r = E_SYSTEM, r, "It is failed to get IMEI value."); imei = *pImei; + +CATCH: + responseMessage.RemoveAll(true); + return r; }