From fbcf2a31fce4bf85341df668fc85f636fb2e8c15 Mon Sep 17 00:00:00 2001 From: Joonho Cho Date: Sat, 6 Apr 2013 17:54:07 +0900 Subject: [PATCH] fix defects reported by PREVENT Change-Id: Ia6a678d585480bf027d8e1e3ce46dee517e8b569 Signed-off-by: Joonho Cho --- inc/FNetNfcNfcManager.h | 6 ++---- src/FNetNfc_NfcSystemAdapter.cpp | 1 + src/FNetNfc_TagConnectionEvent.cpp | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/inc/FNetNfcNfcManager.h b/inc/FNetNfcNfcManager.h index 2d80220..eac2ec9 100755 --- a/inc/FNetNfcNfcManager.h +++ b/inc/FNetNfcNfcManager.h @@ -429,15 +429,13 @@ public: * For more information, see * * Application Filtering. - * @exception E_ILLEGAL_ACCESS This operation is not allowed because the application is not launched by - * Conditional %App Launch. + * @exception E_ILLEGAL_ACCESS This operation is not allowed. @n + * This exception is currently not in use. * @exception E_INVALID_FORMAT The cached data cannot be converted to the NDEF message. * @exception E_OUT_OF_MEMORY The memory is insufficient. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. * @exception E_SYSTEM A system error has occurred. * @remarks - * - This method is available only to the application that is launched by Conditional %App Launch - * until the application is terminated or another tag is detected. * - The input NdefMessage instance should be deleted by the application after it is used, even * outside this method. The NdefMessage::RemoveAllRecords() method should be called with @c true as * the input value immediately before the NdefMessage instance is deleted. diff --git a/src/FNetNfc_NfcSystemAdapter.cpp b/src/FNetNfc_NfcSystemAdapter.cpp index 8ff30d2..a442c57 100644 --- a/src/FNetNfc_NfcSystemAdapter.cpp +++ b/src/FNetNfc_NfcSystemAdapter.cpp @@ -900,6 +900,7 @@ _NfcSystemAdapter::GetCachedByteBufferMessageN(void) "[%s] Failed to get the cached NDEF message. [0x%08X]", GetErrorMessage(r), res); res = nfc_ndef_message_get_rawdata(msgHandle, &pTempBuffer, &bufSize); + nfc_ndef_message_destroy(msgHandle); _NfcConvertErrorResult(pTempBuffer == NULL || res != NFC_ERROR_NONE, r, E_SYSTEM); _NfcConvertErrorResult(res == NFC_ERROR_INVALID_NDEF_MESSAGE, r, E_INVALID_FORMAT); _NfcConvertErrorResult(res == NFC_ERROR_OUT_OF_MEMORY, r, E_OUT_OF_MEMORY); diff --git a/src/FNetNfc_TagConnectionEvent.cpp b/src/FNetNfc_TagConnectionEvent.cpp index ee863aa..afb7c45 100644 --- a/src/FNetNfc_TagConnectionEvent.cpp +++ b/src/FNetNfc_TagConnectionEvent.cpp @@ -104,13 +104,13 @@ _TagConnectionEvent::FireImpl(Tizen::Base::Runtime::IEventListener& listener, co { SysLog(NID_NET_NFC, "_TAG_CON_EVENT_TYPE_RESPONSE_RECEIVED"); - const ByteBuffer* pSrcResponseBuf = null; - ByteBuffer* pDstResponseBuf = pEventArg->GetResponse(); + const ByteBuffer* pSrcResponseBuf = pEventArg->GetResponse(); + ByteBuffer* pDstResponseBuf = null; pConnListener = dynamic_cast (&listener); SysTryReturnVoidResult(NID_NET_NFC, pConnListener != null, E_SYSTEM, "[E_SYSTEM] A dynamic casting failure."); - if (pDstResponseBuf != null) + if (pSrcResponseBuf != null) { pDstResponseBuf = new (std::nothrow) ByteBuffer; SysTryReturnVoidResult(NID_NET_NFC, pDstResponseBuf != null, E_OUT_OF_MEMORY, -- 2.7.4