summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHosang Kim <hosang.kim@samsung.com>2013-04-22 22:59:10 +0900
committerHosang Kim <hosang.kim@samsung.com>2013-04-22 23:40:29 +0900
commita8ee07607fb94578fed090672b0d35ff6ba682eb (patch)
tree2cb238ae7f1f205ff7df64f572ea4ad5f9814ea4
parent2c33682d37a1d2a7550ca60bed59e0f70281940e (diff)
downloadsocial-a8ee07607fb94578fed090672b0d35ff6ba682eb.tar.gz
social-a8ee07607fb94578fed090672b0d35ff6ba682eb.tar.bz2
social-a8ee07607fb94578fed090672b0d35ff6ba682eb.zip
Fixed memory leak
Change-Id: I34b88abe58a8db6ce418b3fce90c2da8e1762223 Signed-off-by: Hosang Kim <hosang.kim@samsung.com>
-rw-r--r--src/FScl_CalendarbookUtil.cpp4
-rw-r--r--src/FScl_RecurrenceImpl.cpp4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/FScl_CalendarbookUtil.cpp b/src/FScl_CalendarbookUtil.cpp
index 8f9d61a..f50361e 100644
--- a/src/FScl_CalendarbookUtil.cpp
+++ b/src/FScl_CalendarbookUtil.cpp
@@ -174,8 +174,10 @@ _CalendarbookUtil::ConvertCharArrayToByteBufferN(const char* pCharArray)
result r = E_SUCCESS;
std::unique_ptr<ByteBuffer> pByteBuffer(new (std::nothrow) ByteBuffer());
SysTryReturn(NID_SCL, pByteBuffer != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
- r = pByteBuffer->Construct(pByteArray.release(), 0, byteBufferLength, byteBufferLength);
+ r = pByteBuffer->Construct(byteBufferLength);
SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ r = pByteBuffer->SetArray(pByteArray.get(), 0, byteBufferLength);
+ pByteBuffer->Rewind();
return pByteBuffer.release();
}
diff --git a/src/FScl_RecurrenceImpl.cpp b/src/FScl_RecurrenceImpl.cpp
index 9ba9a41..bcbd9ba 100644
--- a/src/FScl_RecurrenceImpl.cpp
+++ b/src/FScl_RecurrenceImpl.cpp
@@ -263,7 +263,7 @@ _RecurrenceImpl::SetFrequency(RecurFrequency type)
// reset all properties
if (__pUntil != null)
{
- __pUntil.release();
+ __pUntil.reset();
}
__dayOfWeek = 0;
@@ -315,7 +315,7 @@ _RecurrenceImpl::SetUntil(const DateTime* pUntil)
}
else
{
- __pUntil.release();
+ __pUntil.reset();
__count = _DEFAULT_COUNT;
}