Update snapshot(2017-12-06) 60/163060/1 accepted/tizen/4.0/unified/20171211.061426 submit/tizen_4.0/20171208.074937
authorHongkuk, Son <hongkuk.son@samsung.com>
Thu, 7 Dec 2017 05:28:41 +0000 (14:28 +0900)
committerHongkuk, Son <hongkuk.son@samsung.com>
Thu, 7 Dec 2017 05:29:25 +0000 (14:29 +0900)
Signed-off-by: Hongkuk, Son <hongkuk.son@samsung.com>
Change-Id: Idef59156a36f5d2e636a7487f140f8c236f5bf8d

23 files changed:
packaging/snapshot_history.txt
resource/csdk/connectivity/common/src/cathreadpool_pthreads.c
resource/csdk/connectivity/src/bt_le_adapter/tizen/caleclient.c
resource/csdk/connectivity/src/bt_le_adapter/tizen/calenwmonitor_vd.c
resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver_vd.c
resource/csdk/connectivity/src/camessagehandler.c
resource/csdk/connectivity/src/ip_adapter/caipserver.c
resource/csdk/connectivity/src/ip_adapter/tizen/caipnwmonitor.c
resource/csdk/connectivity/src/tcp_adapter/catcpadapter.c
resource/csdk/connectivity/util/src/camanager/bt_le_manager/tizen/caleconnectionmanager.c
resource/csdk/resource-directory/src/RDClient.cpp
resource/csdk/resource-directory/src/internal/rd_database.c
resource/csdk/routing/src/routingmessageparser.c
resource/csdk/stack/include/ocstack.h
resource/csdk/stack/src/ocstack.c
resource/include/OutOfProcClientWrapper.h
resource/src/CAManager.cpp
service/easy-setup/enrollee/src/resourcehandler.c
service/easy-setup/enrollee/src/resourcehandler.h
service/easy-setup/enrollee/src/samsung/sc_easysetup.c
service/notification/src/consumer/NSConsumerMQPlugin.c
service/notification/src/provider/NSProviderListener.c
service/notification/src/provider/NSProviderTopic.c

index ff3efe3..e659868 100755 (executable)
@@ -1,3 +1,9 @@
+http://suprem.sec.samsung.net/jira/browse/CONPRO-1155
+
+commit_info_2017-12-06.txt
+
+commit_id: f182c56ebbd24b61b710a016c8e7bec4a7fc00fb
+----------------------------------------------------------------------------------------------------------------------------------
 http://suprem.sec.samsung.net/jira/browse/CONPRO-1147
 
 commit_info_2017-11-29.txt
index 8d143e7..7bb19dd 100644 (file)
@@ -215,7 +215,7 @@ CAResult_t ca_thread_pool_add_task(ca_thread_pool_t thread_pool, ca_thread_func
         OICFree(info);
         return CA_STATUS_FAILED;
     }
-    OIC_LOG_V(DEBUG, TAG, "created taskId: %u", threadInfo->taskId);
+    OIC_LOG_V(INFO, TAG, "created thread: %p, taskId: %u", threadInfo->thread, threadInfo->taskId);
     oc_mutex_unlock(thread_pool->details->list_lock);
 
     OIC_LOG_V(DEBUG, TAG, "Out %s", __func__);
@@ -241,10 +241,12 @@ CAResult_t ca_thread_pool_remove_task(ca_thread_pool_t thread_pool, uint32_t tas
         {
             if (threadInfo->taskId == taskId)
             {
-                OIC_LOG_V(INFO, TAG, "waiting.. taskId: %u", threadInfo->taskId);
+                OIC_LOG_V(INFO, TAG, "waiting.. thread: %p, taskId: %u", threadInfo->thread,
+                          threadInfo->taskId);
                 oc_thread_wait(threadInfo->thread);
 
-                OIC_LOG_V(DEBUG, TAG, "removed taskId: %u", threadInfo->taskId);
+                OIC_LOG_V(INFO, TAG, "removed.. thread: %p, taskId: %u", threadInfo->thread,
+                          threadInfo->taskId);
                 u_arraylist_remove(thread_pool->details->threads_list, i);
                 oc_thread_free(threadInfo->thread);
                 OICFree(threadInfo);
@@ -279,10 +281,12 @@ void ca_thread_pool_free(ca_thread_pool_t thread_pool)
             if (threadInfo->thread)
             {
 #ifdef __TIZEN__
-                OIC_LOG_V(INFO, TAG, "canceling.. thread: %p", threadInfo->thread);
+                OIC_LOG_V(INFO, TAG, "canceling.. thread: %p, taskId: %u", threadInfo->thread,
+                          threadInfo->taskId);
                 oc_thread_cancel(threadInfo->thread);
 #endif
-                OIC_LOG_V(INFO, TAG, "waiting.. thread: %p", threadInfo->thread);
+                OIC_LOG_V(INFO, TAG, "waiting.. thread: %p, taskId: %u", threadInfo->thread,
+                          threadInfo->taskId);
                 oc_thread_wait(threadInfo->thread);
                 oc_thread_free(threadInfo->thread);
             }
index 16282b3..06582b5 100644 (file)
@@ -232,6 +232,8 @@ void CALEGattCharacteristicChangedCb(bt_gatt_h characteristic,
                                      char *value,
                                      int valueLen, void *userData)
 {
+    (void)characteristic;
+
     OIC_LOG(DEBUG, TAG, "IN");
     OIC_LOG_V(DEBUG, TAG, "Changed characteristic value length [%d]", valueLen);
 
@@ -255,6 +257,9 @@ void CALEGattCharacteristicChangedCb(bt_gatt_h characteristic,
 
 void CALEGattCharacteristicWriteCb(int result, bt_gatt_h reqHandle, void *userData)
 {
+    (void)reqHandle;
+    (void)userData;
+
     OIC_LOG(DEBUG, TAG, "IN ");
 
     if (BT_ERROR_NONE != result)
@@ -337,6 +342,8 @@ void CALEGattConnectionStateChanged(bool connected, const char *remoteAddress)
 void CALEAdapterScanResultCb(int result, bt_adapter_le_device_scan_result_info_s *scanInfo,
                              void *userData)
 {
+    (void)userData;
+
     OIC_LOG(DEBUG, TAG, "IN");
 
     VERIFY_NON_NULL_VOID(scanInfo, TAG, "scanInfo");
@@ -490,6 +497,8 @@ CAResult_t CAStartLEGattClient()
 
 void CAStartTimerThread(void *data)
 {
+    (void)data;
+
     OIC_LOG(DEBUG, TAG, "IN");
     while (g_isLEGattClientStarted)
     {
@@ -1307,6 +1316,7 @@ exit:
 
 bool CALEClientIsConnected(const char* address)
 {
+    (void)address;
     //@Todo
     return true;
 }
@@ -1321,6 +1331,8 @@ uint16_t CALEClientGetMtuSize(const char* address)
 
 CAResult_t CALEClientSetMtuSize(const char* address, uint16_t mtuSize)
 {
+    (void)mtuSize;
+
     VERIFY_NON_NULL(address, TAG, "address is null");
     //@Todo
     //it should be implemented after update Tizen 3.0
index 30f74fc..ae755bd 100644 (file)
@@ -284,6 +284,9 @@ CAResult_t CAUnSetLENWConnectionStateChangedCb()
 void CALEAdapterStateChangedCb(int result, bt_adapter_state_e adapter_state,
                                           void *user_data)
 {
+    (void)result;
+    (void)user_data;
+
     OIC_LOG(DEBUG, TAG, "IN");
 
     oc_mutex_lock(g_bleDeviceStateChangedCbMutex);
@@ -314,6 +317,9 @@ void CALEAdapterStateChangedCb(int result, bt_adapter_state_e adapter_state,
 void CALENWConnectionStateChangedCb(int result, bool connected,
                                     const char *remoteAddress, void *userData)
 {
+    (void)result;
+    (void)userData;
+
     OIC_LOG(DEBUG, TAG, "IN");
 
     VERIFY_NON_NULL_VOID(remoteAddress, TAG, "remote address is NULL");
index ab1f153..e5a71d3 100755 (executable)
@@ -186,6 +186,11 @@ void CALEServerNotificationSentCB(int result, char *remote_address, bt_gatt_serv
                                   bt_gatt_h characteristic, bool completed, void *user_data)
 #endif
 {
+    (void)server;
+    (void)characteristic;
+    (void)completed;
+    (void)user_data;
+
     OIC_LOG_V(DEBUG, TAG, "Notification to the device[%s] result[%d]", remote_address, result);
 }
 
@@ -280,6 +285,10 @@ CAResult_t CAStartLEGattServer()
 void CALENotificationCb(bool notify, bt_gatt_server_h server, bt_gatt_h gatt_handle,
                         void *user_data)
 {
+    (void)server;
+    (void)gatt_handle;
+    (void)user_data;
+
     OIC_LOG(DEBUG, TAG, "IN");
     if (notify)
     {
@@ -683,6 +692,10 @@ void CALEGattRemoteCharacteristicWriteCb(char *remoteAddress, bt_gatt_server_h s
                                          int charLen, void *userData)
 #endif
 {
+    (void)server;
+    (void)gatt_handle;
+    (void)userData;
+
     OIC_LOG(INFO, TAG, "IN - WriteCharCB");
 
     if (NULL == charValue || NULL == remoteAddress)
@@ -1019,6 +1032,7 @@ void CASetBLEServerErrorHandleCallback(CABLEErrorHandleCallback callback)
 
 bool CALEServerIsConnected(const char* address)
 {
+    (void)address;
     //@Todo
     return true;
 }
index 394a728..2abb152 100755 (executable)
@@ -895,6 +895,8 @@ static void CAAdapterStateChangedCallback(CATransportAdapter_t transportType, bo
 
 static bool CAClearQueueEndpointDataContext(void *data, uint32_t size, void *ctx)
 {
+    (void)size;
+
     if (NULL == data || NULL == ctx)
     {
         return false;
@@ -1272,6 +1274,8 @@ CAResult_t CAInitializeMessageHandler(CATransportAdapter_t transportType)
 
 static bool CAClearQueueAdapterDataContext(void *data, uint32_t size, void *ctx)
 {
+    (void)size;
+
     if (NULL == data || NULL == ctx)
     {
         return false;
index f4484b9..87afa90 100644 (file)
@@ -217,6 +217,8 @@ static int cleanup_pop_arg = 1;
 
 static void CAIPCleanupHandler(void *arg)
 {
+    (void)arg;
+
     OIC_LOG(DEBUG, TAG, "Called clean-up handler");
 
     if (caglobals.ip.shutdownFds[0] != OC_INVALID_SOCKET)
index 73f391c..079ecd5 100644 (file)
@@ -386,6 +386,8 @@ static CAInterface_t *CANewInterfaceItem(int index, char *name, int family,
 
 void CAIPConnectionStateChangedCb(connection_type_e type, void* userData)
 {
+    (void)userData;
+
     switch (type)
     {
         case CONNECTION_TYPE_DISCONNECTED:
index 165e3db..45c8ab9 100644 (file)
@@ -444,6 +444,8 @@ CAResult_t CAStartTCP()
 
 static bool CAClearQueueEndpointDataContext(void *data, uint32_t size, void *ctx)
 {
+    (void)size;
+
     if (NULL == data || NULL == ctx)
     {
         return false;
index ecb6f61..d0f13bb 100644 (file)
@@ -41,8 +41,9 @@ static void CAManagerConnectionMonitorHandler(CATransportAdapter_t adapter,
 void CASetLENetworkMonitorCallbacks(CAAdapterStateChangedCB adapterStateCB,
                                     CAConnectionStateChangedCB connStateCB)
 {
+    (void)adapterStateCB;
+    (void)connStateCB;
     OIC_LOG(DEBUG, TAG, "CASetLENetworkMonitorCallbacks");
-
 }
 
 CAResult_t CAManagerLEStartAdvertising()
index 36140bd..cc1dfc0 100644 (file)
@@ -32,6 +32,7 @@
 #include "OCPlatform.h"
 #include "OCException.h"
 #include "ocpayload.h"
+#include "oic_malloc.h"
 
 using namespace OC;
 
@@ -88,10 +89,21 @@ OCStackApplicationResult publishResourceToRDCallback(void* ctx, OCDoHandle /*han
                     char *uri = NULL;
                     OCRepPayloadGetPropString(links[i], OC_RSRVD_HREF, &uri);
                     OCResourceHandle handle = OCGetResourceHandleAtUri(uri);
+
                     int64_t ins = 0;
                     OCRepPayloadGetPropInt(links[i], OC_RSRVD_INS, &ins);
                     OCBindResourceInsToResource(handle, ins);
+
+                    OICFree(uri);
+                }
+
+                // Free links
+                size_t count = calcDimTotal(dimensions);
+                for (size_t k = 0; k < count; k++)
+                {
+                    OCRepPayloadDestroy(links[k]);
                 }
+                OICFree(links);
             }
             OCRepresentation rep = parseRDResponseCallback(clientResponse);
             std::thread exec(context->callback, rep, clientResponse->result);
index 8be91e9..c178b36 100644 (file)
@@ -279,16 +279,20 @@ static int storeLinkPayload(OCRepPayload *rdPayload, int64_t rowid)
             char **itf = NULL;
             OCRepPayloadGetStringArray(link, OC_RSRVD_INTERFACE, &itf, itfDim);
 
-            if (SQLITE_DONE != sqlite3_step(stmt))
+            int sqlRet = sqlite3_step(stmt);
+            if (SQLITE_DONE != sqlRet)
             {
                 sqlite3_finalize(stmt);
-                return res;
             }
-            VERIFY_SQLITE(sqlite3_exec(gRDDB, "COMMIT", NULL, NULL, NULL));
+            else
+            {
+                VERIFY_SQLITE(sqlite3_exec(gRDDB, "COMMIT", NULL, NULL, NULL));
+
+                int64_t ins = sqlite3_last_insert_rowid(gRDDB);
+                VERIFY_SQLITE(storeResourceType(rt, rtDim[0], ins));
+                VERIFY_SQLITE(storeInterfaceType(itf, itfDim[0], ins));
+            }
 
-            int64_t ins = sqlite3_last_insert_rowid(gRDDB);
-            VERIFY_SQLITE(storeResourceType(rt, rtDim[0], ins));
-            VERIFY_SQLITE(storeInterfaceType(itf, itfDim[0], ins));
             OICFree(uri);
             OCPayloadDestroy((OCPayload *)p);
             for (j = 0; j < mtDim[0]; j++)
@@ -309,10 +313,30 @@ static int storeLinkPayload(OCRepPayload *rdPayload, int64_t rowid)
             }
             OICFree(itf);
 
+            if (SQLITE_DONE != sqlRet)
+            {
+                // Free links
+                size_t count = calcDimTotal(dimensions);
+                for (size_t k = 0; k < count; k++)
+                {
+                    OCRepPayloadDestroy(links[k]);
+                }
+                OICFree(links);
+
+                return res;
+            }
         }
 
         VERIFY_SQLITE(sqlite3_finalize(stmt));
         res = SQLITE_OK;
+
+        // Free links
+        size_t count = calcDimTotal(dimensions);
+        for (size_t k = 0; k < count; k++)
+        {
+            OCRepPayloadDestroy(links[k]);
+        }
+        OICFree(links);
     }
     return res;
 }
@@ -346,6 +370,7 @@ OCStackResult OCRDDatabaseStoreResources(OCRepPayload *payload, const OCDevAddr
     if (SQLITE_DONE != sqlite3_step(stmt))
     {
         sqlite3_finalize(stmt);
+        OICFree(deviceid);
         return OC_STACK_ERROR;
     }
     VERIFY_SQLITE(sqlite3_finalize(stmt));
index 7ee337c..81f460a 100644 (file)
@@ -278,12 +278,10 @@ OCStackResult RMPParseResponsePayload(const OCRepPayload *payload, uint32_t *gat
         return OC_STACK_OK;
     }
 
-    OCRepPayload **responsePayload[len];
-
+    OCRepPayload **responsePayload = NULL;
     size_t dimensions[MAX_REP_ARRAY_DEPTH];
-    OCRepPayloadGetPropObjectArray(payload, TABLE, responsePayload, dimensions);
-
-    if (NULL == *responsePayload)
+    OCRepPayloadGetPropObjectArray(payload, TABLE, &responsePayload, dimensions);
+    if (NULL == responsePayload)
     {
         OIC_LOG(DEBUG, TAG, "RMPParsePayload OUT");
         return OC_STACK_OK;
@@ -293,17 +291,17 @@ OCStackResult RMPParseResponsePayload(const OCRepPayload *payload, uint32_t *gat
     if (NULL == *gatewayTable)
     {
         OIC_LOG(DEBUG, TAG, "Gateway table create failed");
-        return OC_STACK_ERROR;
+        goto error_exit;
     }
 
+    size_t resPayloadSize = calcDimTotal(dimensions);
     for (int i = 0; i < len; i++)
     {
         RTMGatewayEntry_t *entry = (RTMGatewayEntry_t *)OICCalloc(1, sizeof(RTMGatewayEntry_t));
-
         if (NULL == entry)
         {
             OIC_LOG(DEBUG, TAG, "RTMGatewayEntry_t Calloc failed");
-            return OC_STACK_ERROR;
+            goto error_exit;
         }
         // Filling new Entry
         entry->destination = (RTMGatewayId_t*)OICCalloc(1, sizeof(RTMGatewayId_t));
@@ -311,7 +309,7 @@ OCStackResult RMPParseResponsePayload(const OCRepPayload *payload, uint32_t *gat
         {
             OIC_LOG(DEBUG, TAG, "Destination Calloc failed");
             OICFree(entry);
-            return OC_STACK_ERROR;
+            goto error_exit;
         }
         entry->nextHop = (RTMGatewayId_t*)OICCalloc(1, sizeof(RTMGatewayId_t));
         if (NULL == entry->nextHop)
@@ -319,22 +317,37 @@ OCStackResult RMPParseResponsePayload(const OCRepPayload *payload, uint32_t *gat
             OIC_LOG(DEBUG, TAG, "nextHop Calloc failed");
             OICFree(entry->destination);
             OICFree(entry);
-            return OC_STACK_ERROR;
+            goto error_exit;
         }
 
         entry->nextHop->gatewayId = *gatewayId;
 
         int64_t gatewayBuf;
         int64_t routeCost;
-        OCRepPayloadGetPropInt(*((*responsePayload) + i), GATEWAY, &gatewayBuf);
-        OCRepPayloadGetPropInt(*((*responsePayload) + i), ROUTE_COST, &routeCost);
+        OCRepPayloadGetPropInt(responsePayload[i], GATEWAY, &gatewayBuf);
+        OCRepPayloadGetPropInt(responsePayload[i], ROUTE_COST, &routeCost);
 
         entry->destination->gatewayId = gatewayBuf;
         entry->routeCost = routeCost;
         u_linklist_add(*gatewayTable, (void *)entry);
     }
+
+    for (size_t k = 0; k < resPayloadSize; k++)
+    {
+        OCRepPayloadDestroy(responsePayload[k]);
+    }
+    OICFree(responsePayload);
+
     OIC_LOG(DEBUG, TAG, "RMPParsePayload OUT");
     return OC_STACK_OK;
+
+error_exit:
+    for (size_t k = 0; k < resPayloadSize; k++)
+    {
+        OCRepPayloadDestroy(responsePayload[k]);
+    }
+    OICFree(responsePayload);
+    return OC_STACK_ERROR;
 }
 
 void RMPFreePayload(OCRepPayload *payload)
index 2a9f595..b541552 100644 (file)
@@ -144,7 +144,7 @@ OCStackResult OCProcess();
  *                          favor of destination.)
  * @param destination       Complete description of destination.
  * @param payload           Encoded request payload,
                           OCDoResource will free given payload when return OC_STATUS_OK.
*                          OCDoResource will free given payload.
  * @param connectivityType  Modifier flags when destination is not given.
  * @param qos               Quality of service. Note that if this API is called on a uri with the
  *                          well-known multicast IP address, the qos will be forced to ::OC_LOW_QOS
@@ -189,7 +189,7 @@ OCStackResult OCDoResource(OCDoHandle *handle,
  *                          favor of destination.)
  * @param destination       Complete description of destination.
  * @param payload           Encoded request payload.
                           OCDoRequest does not free given payload.
*                          OCDoRequest does not free given payload.
  * @param connectivityType  Modifier flags when destination is not given.
  * @param qos               Quality of service. Note that if this API is called on a uri with the
  *                          well-known multicast IP address, the qos will be forced to ::OC_LOW_QOS
index 15bdaee..a0e4029 100644 (file)
@@ -1276,9 +1276,9 @@ OCStackResult HandlePresenceResponse(const CAEndpoint_t *endpoint,
         }
     }
 
-    OIC_LOG(INFO, TAG, "Callback for presence");
-
+    OIC_LOG(INFO, TAG, "Before calling into application address space for presence");
     cbResult = cbNode->callBack(cbNode->context, cbNode->handle, &response);
+    OIC_LOG(INFO, TAG, "After calling into application address space for presence");
 
     if (cbResult == OC_STACK_DELETE_TRANSACTION)
     {
@@ -1378,7 +1378,6 @@ void OCHandleResponse(const CAEndpoint_t* endPoint, const CAResponseInfo_t* resp
         else if(responseInfo->result == CA_RETRANSMIT_TIMEOUT)
         {
             OIC_LOG(INFO, TAG, "Receiving A Timeout for this token");
-            OIC_LOG(INFO, TAG, "Calling into application address space");
 
             OCClientResponse response =
                 {.devAddr = {.adapter = OC_DEFAULT_ADAPTER}};
@@ -1390,10 +1389,12 @@ void OCHandleResponse(const CAEndpoint_t* endPoint, const CAResponseInfo_t* resp
             response.identity.id_length = responseInfo->info.identity.id_length;
 
             response.result = CAResponseToOCStackResult(responseInfo->result);
+            OIC_LOG(INFO, TAG, "Before calling into application address space for reTrans timeout");
             cbNode->callBack(cbNode->context,
                     cbNode->handle, &response);
+            OIC_LOG(INFO, TAG, "After calling into application address space for reTrans timeout");
             FindAndDeleteClientCB(cbNode);
-            OICFree(response.resourceUri);
+            OICFree((void *)response.resourceUri);
         }
 #ifdef __TIZENRT__
         else if ((cbNode->method == OC_REST_OBSERVE || cbNode->method == OC_REST_OBSERVE_ALL)
@@ -1409,9 +1410,12 @@ void OCHandleResponse(const CAEndpoint_t* endPoint, const CAResponseInfo_t* resp
             response.identity.id_length = responseInfo->info.identity.id_length;
             response.result = OC_STACK_UNAUTHORIZED_REQ;
 
+            OIC_LOG(INFO, TAG, "Before calling into application address space for observe resp");
             cbNode->callBack(cbNode->context,
                              cbNode->handle,
                              &response);
+            OIC_LOG(INFO, TAG, "After calling into application address space for observe resp");
+
             FindAndDeleteClientCB(cbNode);
             OICFree(response.resourceUri);
         }
@@ -1419,7 +1423,6 @@ void OCHandleResponse(const CAEndpoint_t* endPoint, const CAResponseInfo_t* resp
         else
         {
             OIC_LOG(INFO, TAG, "This is a regular response, A client call back is found");
-            OIC_LOG(INFO, TAG, "Calling into application address space");
 
             OCClientResponse response;
             memset(&response, 0, sizeof(OCClientResponse));
@@ -1486,7 +1489,7 @@ void OCHandleResponse(const CAEndpoint_t* endPoint, const CAResponseInfo_t* resp
                     {
                         OIC_LOG_V(ERROR, TAG, "Unknown Payload type in Discovery: %d %s",
                                 cbNode->method, cbNode->requestUri);
-                        OICFree(response.resourceUri);
+                        OICFree((void *)response.resourceUri);
                         return;
                     }
                 }
@@ -1524,7 +1527,7 @@ void OCHandleResponse(const CAEndpoint_t* endPoint, const CAResponseInfo_t* resp
                 {
                     OIC_LOG_V(ERROR, TAG, "Unknown Payload type: %d %s",
                             cbNode->method, cbNode->requestUri);
-                    OICFree(response.resourceUri);
+                    OICFree((void *)response.resourceUri);
                     return;
                 }
 
@@ -1538,7 +1541,7 @@ void OCHandleResponse(const CAEndpoint_t* endPoint, const CAResponseInfo_t* resp
                     {
                         OIC_LOG(ERROR, TAG, "Error converting payload");
                         OCPayloadDestroy(response.payload);
-                        OICFree(response.resourceUri);
+                        OICFree((void *)response.resourceUri);
                         return;
                     }
                 }
@@ -1579,7 +1582,7 @@ void OCHandleResponse(const CAEndpoint_t* endPoint, const CAResponseInfo_t* resp
                 {
                     OIC_LOG(ERROR, TAG, "#header options are more than MAX_HEADER_OPTIONS");
                     OCPayloadDestroy(response.payload);
-                    OICFree(response.resourceUri);
+                    OICFree((void *)response.resourceUri);
                     return;
                 }
 
@@ -1650,9 +1653,12 @@ void OCHandleResponse(const CAEndpoint_t* endPoint, const CAResponseInfo_t* resp
                     HandleBatchResponse(cbNode->requestUri, (OCRepPayload **)&response.payload);
                 }
 
+                OIC_LOG(INFO, TAG, "Before calling into application address space for handleResponse");
                 OCStackApplicationResult appFeedback = cbNode->callBack(cbNode->context,
                                                                         cbNode->handle,
                                                                         &response);
+                OIC_LOG(INFO, TAG, "After calling into application address space for handleResponse");
+
                 cbNode->sequenceNumber = response.sequenceNumber;
 
                 if (appFeedback == OC_STACK_DELETE_TRANSACTION)
@@ -1678,7 +1684,7 @@ void OCHandleResponse(const CAEndpoint_t* endPoint, const CAResponseInfo_t* resp
                 }
             }
 
-            OICFree(response.resourceUri);
+            OICFree((void *)response.resourceUri);
             OCPayloadDestroy(response.payload);
         }
         return;
@@ -1826,7 +1832,9 @@ void HandleCAErrorResponse(const CAEndpoint_t *endPoint, const CAErrorInfo_t *er
         response.identity.id_length = errorInfo->info.identity.id_length;
         response.result = CAResultToOCResult(errorInfo->result);
 
+        OIC_LOG(INFO, TAG, "Before calling into application address space for error response");
         cbNode->callBack(cbNode->context, cbNode->handle, &response);
+        OIC_LOG(INFO, TAG, "After calling into application address space for error response");
     }
 
     ResourceObserver *observer = GetObserverUsingToken(errorInfo->info.token,
@@ -2357,6 +2365,9 @@ OCStackResult OCInit(const char *ipAddr, uint16_t port, OCMode mode)
 
 OCStackResult OCInit1(OCMode mode, OCTransportFlags serverFlags, OCTransportFlags clientFlags)
 {
+    OC_UNUSED(serverFlags);
+    OC_UNUSED(clientFlags);
+
     OIC_LOG(DEBUG, TAG, "call OCInit1");
     return OCInit2(mode, OC_DEFAULT_FLAGS, OC_DEFAULT_FLAGS, OC_DEFAULT_ADAPTER);
 }
@@ -3335,7 +3346,10 @@ OCStackResult OCProcessPresence()
             OIC_LOG_V(DEBUG, TAG, "moving to TTL level %d",
                                         cbNode->presence->TTLlevel);
 
+            OIC_LOG(INFO, TAG, "Before calling into application address space for presence timeout");
             cbResult = cbNode->callBack(cbNode->context, cbNode->handle, &clientResponse);
+            OIC_LOG(INFO, TAG, "After calling into application address space for presence timeout");
+
             if (cbResult == OC_STACK_DELETE_TRANSACTION)
             {
                 FindAndDeleteClientCB(cbNode);
@@ -5193,8 +5207,19 @@ OCStackResult OCUpdateResourceInsWithResponse(const char *requestUri,
                                 {
                                     OCBindResourceInsToResource(handle, ins);
                                 }
+
+                                OICFree(uri);
+                                uri = NULL;
                             }
                         }
+
+                        // Free links
+                        size_t count = calcDimTotal(dimensions);
+                        for (size_t k = 0; k < count; k++)
+                        {
+                            OCRepPayloadDestroy(links[k]);
+                        }
+                        OICFree(links);
                     }
                 }
             }
index 6ac5a6b..02db304 100644 (file)
@@ -192,11 +192,11 @@ namespace OC
             {return OC_STACK_NOTIMPL;}
 #endif
 #ifdef TCP_ADAPTER
-        virtual OCStackResult findKeepAliveResource(std::string host,
-                                                    KeepAliveCallback resultCallback)
+        virtual OCStackResult findKeepAliveResource(std::string /*host*/,
+                                                    KeepAliveCallback /*resultCallback*/)
             {return OC_STACK_NOTIMPL;}
-        virtual OCStackResult sendKeepAliveRequest(std::string host, const OCRepresentation& rep,
-                                                   KeepAliveCallback resultCallback)
+        virtual OCStackResult sendKeepAliveRequest(std::string /*host*/, const OCRepresentation& /*rep*/,
+                                                   KeepAliveCallback /*resultCallback*/)
             {return OC_STACK_NOTIMPL;}
 #endif
     };
index afb6e18..cb9ea40 100644 (file)
@@ -61,7 +61,9 @@ void DefaultAdapterStateChangedHandler(CATransportAdapter_t adapter, bool enable
 {
     if (g_adapterHandler)
     {
+        OIC_LOG(INFO, TAG, "Before calling into application address space for adapterStateChanged");
         g_adapterHandler((OCTransportAdapter) adapter, enabled);
+        OIC_LOG(INFO, TAG, "After calling into application address space for adapterStateChanged");
     }
 }
 
@@ -89,7 +91,9 @@ void DefaultConnectionStateChangedHandler(const CAEndpoint_t *info, bool isConne
         OCConnectivityType connType = (OCConnectivityType)
                 ((adapter << CT_ADAPTER_SHIFT) | (flags & CT_MASK_FLAGS));
 
+        OIC_LOG(INFO, TAG, "Before calling into application address space for connectionStateChanged");
         g_connectionHandler(ss.str(), connType, isConnected);
+        OIC_LOG(INFO, TAG, "After calling into application address space for connectionStateChanged");
     }
 }
 
index eb626c8..d3dc37b 100755 (executable)
@@ -426,6 +426,8 @@ void updateWiFiConfResource(OCRepPayload* input)
         OIC_LOG(DEBUG, ES_RH_TAG, "Enrollee doesn't have any observer.");
     }
 
+    OICFree(ssid);
+    OICFree(cred);
     OICFree(wiFiData);
 }
 
@@ -511,6 +513,10 @@ void updateCoapCloudConfResource(OCRepPayload* input)
         OIC_LOG(DEBUG, ES_RH_TAG, "CoapCloudConf resource doesn't have any observer.");
     }
 
+    OICFree(authCode);
+    OICFree(accessToken);
+    OICFree(authProvider);
+    OICFree(ciServer);
     OICFree(cloudData);
 }
 
index 851f047..3696171 100755 (executable)
@@ -101,6 +101,7 @@ OCEntityHandlerResult CheckEhRequestPayload(OCEntityHandlerRequest *ehRequest);
 void RegisterWifiRsrcEventCallBack(ESWiFiConfCB);
 void RegisterCloudRsrcEventCallBack(ESCoapCloudConfCB);
 void RegisterDevConfRsrcEventCallBack(ESDevConfCB);
+void RegisterConnectRequestEventCallBack(ESConnectRequestCB);
 void UnRegisterResourceEventCallBack(void);
 ESResult SetCallbackForUserData(ESReadUserdataCb readCb, ESWriteUserdataCb writeCb);
 
index 98e1eb8..5c7a2e3 100755 (executable)
@@ -76,7 +76,8 @@ static void ReadAccountData(OCRepPayload* payload,void** userdata)
             if( *userdata == NULL )
             {
                 OIC_LOG(ERROR, SC_ENROLLEE_TAG, "OICMalloc for SCDevConfProperties is failed");
-                return ;
+                OICFree(account);
+                return;
             }
         }
 
@@ -87,6 +88,7 @@ static void ReadAccountData(OCRepPayload* payload,void** userdata)
         OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %s",
                 SC_RSRVD_ES_VENDOR_ACCOUNT, pDevConfProp->account);
 
+        OICFree(account);
     }
     OIC_LOG(INFO, SC_ENROLLEE_TAG, "ReadAccountData OUT");
 
index b59fc46..92ce709 100644 (file)
@@ -140,6 +140,13 @@ OCStackApplicationResult NSConsumerIntrospectMQTopic(
         }
     }
 
+    // Free topicList
+    size_t count = calcDimTotal(dimensions);
+    for (size_t k = 0; k < count; k++)
+    {
+        OICFree(topicList[k]);
+    }
+    OICFree(topicList);
 
     return OC_STACK_KEEP_TRANSACTION;
 }
index ea371cc..8f6cc9c 100644 (file)
@@ -431,6 +431,14 @@ OCStackApplicationResult NSProviderGetMQResponseCB(void * ctx, OCDoHandle handle
         }\r
     }\r
 \r
+    // Free topic list\r
+    size_t count = calcDimTotal(dimensions);\r
+    for (size_t k = 0; k < count; k++)\r
+    {\r
+        OICFree(topicList[k]);\r
+    }\r
+    OICFree(topicList);\r
+\r
     NS_LOG(DEBUG, "NSProviderGetMQResponseCB - OUT");\r
     return OC_STACK_KEEP_TRANSACTION;\r
 }\r
index a262f89..055dc47 100644 (file)
@@ -412,6 +412,14 @@ NSResult NSPostConsumerTopics(OCEntityHandlerRequest * entityHandlerRequest)
                 NSOICFree(topicSubData->topicName);
                 NSOICFree(topicSubData);
                 NSOICFree(consumerId);
+
+                // Free topic list
+                for (size_t k = 0; k < dimensionSize; k++)
+                {
+                    OCRepPayloadDestroy(topicListPayload[k]);
+                }
+                OICFree(topicListPayload);
+
                 return NS_FAIL;
             }
 
@@ -425,6 +433,14 @@ NSResult NSPostConsumerTopics(OCEntityHandlerRequest * entityHandlerRequest)
         }
     }
     NSSendTopicUpdationToConsumer(consumerId);
+
+    // Free topic list
+    for (size_t k = 0; k < dimensionSize; k++)
+    {
+        OCRepPayloadDestroy(topicListPayload[k]);
+    }
+    OICFree(topicListPayload);
+
     NSOICFree(consumerId);
     NS_LOG(DEBUG, "NSPostConsumerTopics() - OUT");
     return NS_OK;