fix defects reported by PREVENT
authorJoonho Cho <jh03.cho@samsung.com>
Sat, 6 Apr 2013 08:54:07 +0000 (17:54 +0900)
committerJoonho Cho <jh03.cho@samsung.com>
Sat, 6 Apr 2013 08:54:07 +0000 (17:54 +0900)
Change-Id: Ia6a678d585480bf027d8e1e3ce46dee517e8b569
Signed-off-by: Joonho Cho <jh03.cho@samsung.com>
inc/FNetNfcNfcManager.h
src/FNetNfc_NfcSystemAdapter.cpp
src/FNetNfc_TagConnectionEvent.cpp

index 2d80220..eac2ec9 100755 (executable)
@@ -429,15 +429,13 @@ public:
         *                                      For more information, see
         *                                      <a href=”../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm”>
         *                                      Application Filtering</a>.
-        * @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.
index 8ff30d2..a442c57 100644 (file)
@@ -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);
index ee863aa..afb7c45 100644 (file)
@@ -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 <ITagConnectionListener*>(&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,