From 15e097d847eb1d5cfb38c39a3b7ac5beca98718b Mon Sep 17 00:00:00 2001 From: Sunwook Bae Date: Fri, 5 Apr 2013 10:06:55 +0900 Subject: [PATCH] Fix prevent issues(IO) Change-Id: Ib22bbfceb119c9ff2cbb9b25ff3369d8da4983df Signed-off-by: Sunwook Bae --- src/io/FIo_MessagePortProxy.cpp | 6 ++++-- src/server/io/FIo_IpcServer.cpp | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/io/FIo_MessagePortProxy.cpp b/src/io/FIo_MessagePortProxy.cpp index 4cc91b7..57a7217 100644 --- a/src/io/FIo_MessagePortProxy.cpp +++ b/src/io/FIo_MessagePortProxy.cpp @@ -125,7 +125,7 @@ OnMessageReceived(int id, const char* remote_app_id, const char* remote_port, bo SysTryCatch(NID_IO, pMap != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); result r = pMap->Construct(); - SysTryCatch(NID_IO, r == E_SUCCESS, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + SysTryCatch(NID_IO, r == E_SUCCESS, delete pMap, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); SysLog(NID_IO, "bundle to map"); @@ -176,7 +176,7 @@ OnTrustedMessageReceived(int id, const char* remote_app_id, const char* remote_p SysTryCatch(NID_IO, pMap != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); result r = pMap->Construct(); - SysTryCatch(NID_IO, r == E_SUCCESS, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + SysTryCatch(NID_IO, r == E_SUCCESS, delete pMap, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); bundle_foreach(data, ConvertBundleToMap, pMap); @@ -498,6 +498,7 @@ _MessagePortProxy::ConvertMapToBundleN(const HashMap* pMap) { SysLog(NID_IO, "Not supported"); + bundle_free(b); return null; } } @@ -506,6 +507,7 @@ _MessagePortProxy::ConvertMapToBundleN(const HashMap* pMap) { SysLog(NID_IO, "Not supported"); + bundle_free(b); return null; } } diff --git a/src/server/io/FIo_IpcServer.cpp b/src/server/io/FIo_IpcServer.cpp index 24a0d53..f6f9f83 100644 --- a/src/server/io/FIo_IpcServer.cpp +++ b/src/server/io/FIo_IpcServer.cpp @@ -217,7 +217,9 @@ _IpcServer::Construct(const String& name, const _IIpcServerEventListener& listen SysTryCatch(NID_IO, ret == 0, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Failed to change permission of a socket(%d, %s): %s", serverSocket, socketName.c_str(), strerror(errno)); - listen(serverSocket, 15); + ret = listen(serverSocket, 15); + SysTryCatch(NID_IO, ret == 0, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Failed to listen the socket(%d, %s): %s", serverSocket, + socketName.c_str(), strerror(errno)); pGIOChannel = g_io_channel_unix_new(serverSocket); SysTryCatch(NID_IO, pGIOChannel != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Not enough memory."); -- 2.7.4