From 3f929c78ad112895f566bef07d5cc740c96e76fe Mon Sep 17 00:00:00 2001 From: SeungYeup Kim Date: Wed, 3 Apr 2013 20:40:23 +0900 Subject: [PATCH] Fix prevent issue Change-Id: I973367e07880e63580d7e28132fbfac828c9193a --- src/io/FIo_DataRowImpl.cpp | 5 ++++- src/io/FIo_DataSetEnumeratorImpl.cpp | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) mode change 100644 => 100755 src/io/FIo_DataRowImpl.cpp mode change 100644 => 100755 src/io/FIo_DataSetEnumeratorImpl.cpp diff --git a/src/io/FIo_DataRowImpl.cpp b/src/io/FIo_DataRowImpl.cpp old mode 100644 new mode 100755 index 6e6f7be..97f211c --- a/src/io/FIo_DataRowImpl.cpp +++ b/src/io/FIo_DataRowImpl.cpp @@ -135,6 +135,7 @@ _DataRowImpl::SetDateTimeAt(int columnIndex, const Tizen::Base::DateTime& value) result r = E_SUCCESS; Integer* pColumnType = null; int nColumnType = DB_COLUMNTYPE_UNDEFINED; + char* pDateTimeStr; SysTryReturnResult(NID_IO, columnIndex >= 0 && columnIndex < __columnCount, E_INVALID_ARG, "Wrong column index."); @@ -145,7 +146,9 @@ _DataRowImpl::SetDateTimeAt(int columnIndex, const Tizen::Base::DateTime& value) E_TYPE_MISMATCH, "Type mismatch"); unique_ptr<_DataItem>pItem(new (std::nothrow) _DataItem()); - unique_ptr pString(new (std::nothrow) String(_StringConverter::CopyToCharArrayN(value.ToString()))); + pDateTimeStr = _StringConverter::CopyToCharArrayN(value.ToString()); + unique_ptr pString(new (std::nothrow) String(pDateTimeStr)); + delete pDateTimeStr; SysTryReturnResult(NID_IO, pItem != null && pString != null, E_OUT_OF_MEMORY, "The memory is insufficient."); diff --git a/src/io/FIo_DataSetEnumeratorImpl.cpp b/src/io/FIo_DataSetEnumeratorImpl.cpp old mode 100644 new mode 100755 index c8daadd..b3e5d8f --- a/src/io/FIo_DataSetEnumeratorImpl.cpp +++ b/src/io/FIo_DataSetEnumeratorImpl.cpp @@ -346,10 +346,9 @@ _DataSetEnumeratorImpl::GetDateTimeAt(int columnIndex, DateTime& value) const } pStr = (String*)pDataItem->pObj; + r = DateTime::Parse(*pStr, value); } - r = DateTime::Parse(*pStr, value); - // fall thru CATCH: return r; -- 2.7.4