{
const xmlChar* pPropValue = reinterpret_cast<const xmlChar*>("value");
- std::unique_ptr<ByteBuffer> pBuf(Tizen::Base::Utility::StringUtil::StringToUtf8N(value));
- if (pBuf)
+ if (value.IsEmpty())
{
- xmlAttrPtr attrPtr = xmlSetProp(pNode, pPropValue, reinterpret_cast<const xmlChar*>(pBuf->GetPointer()));
+ const xmlChar* pZeroLength = reinterpret_cast<const xmlChar*>("");
+ xmlAttrPtr attrPtr = xmlSetProp(pNode, pPropValue, pZeroLength);
if (attrPtr)
{
return true;
}
else
{
- SysLog(NID_APP, "StringToUtf8N is failed.");
+ std::unique_ptr<ByteBuffer> pBuf(Tizen::Base::Utility::StringUtil::StringToUtf8N(value));
+ if (pBuf)
+ {
+ xmlAttrPtr attrPtr = xmlSetProp(pNode, pPropValue, reinterpret_cast<const xmlChar*>(pBuf->GetPointer()));
+ if (attrPtr)
+ {
+ return true;
+ }
+ }
+ else
+ {
+ SysLog(NID_APP, "StringToUtf8N is failed.");
+ }
}
return false;
}
unique_ptr<_DataItem>pItem(new (std::nothrow) _DataItem());
pDateTimeStr = _StringConverter::CopyToCharArrayN(value.ToString());
unique_ptr<String> pString(new (std::nothrow) String(pDateTimeStr));
- delete pDateTimeStr;
+ delete[] pDateTimeStr;
SysTryReturnResult(NID_IO, pItem != null && pString != null, E_OUT_OF_MEMORY,
"The memory is insufficient.");
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");
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);
{
SysLog(NID_IO, "Not supported");
+ bundle_free(b);
return null;
}
}
{
SysLog(NID_IO, "Not supported");
+ bundle_free(b);
return null;
}
}
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.");