[IOT-3022] Fix ResetClouds() api 85/25685/3
authorVitalii Irkha <v.irkha@samsung.com>
Wed, 6 Jun 2018 16:43:51 +0000 (19:43 +0300)
committerVitalii Irkha <v.irkha@samsung.com>
Thu, 7 Jun 2018 11:28:21 +0000 (14:28 +0300)
Fixed minor issues

Change-Id: I95ea9ae239336c7b602d55569d2c2f9b5b2976d3
Signed-off-by: Vitalii Irkha <v.irkha@samsung.com>
resource/csdk/security/provisioning/sample/oic_svr_db_server_justworks.dat
resource/csdk/security/provisioning/sample/oic_svr_db_server_justworks.json
resource/csdk/security/provisioning/src/cloud/auth.c
resource/csdk/security/provisioning/src/cloud/cloudresource.c

index 6ffd257..d158ec3 100644 (file)
Binary files a/resource/csdk/security/provisioning/sample/oic_svr_db_server_justworks.dat and b/resource/csdk/security/provisioning/sample/oic_svr_db_server_justworks.dat differ
index 12546d8..88a2329 100644 (file)
@@ -36,6 +36,7 @@
                 "resources": [
                     { "href": "/oic/sec/doxm" },
                     { "href": "/oic/sec/roles" },
+                    { "href": "/CoapCloudConfResURI" },
                     { "wc": "+" }
                 ],
                 "permission": 14
index 2d11ed3..e84b4a6 100644 (file)
@@ -112,6 +112,7 @@ OicCloud_t *FreeCloud(OicCloud_t *cloud)
         }
 
         res = oc_thread_free(cloud->pid);
+        cloud->pid = NULL;
 
         if (OC_THREAD_SUCCESS != res)
         {
@@ -119,7 +120,6 @@ OicCloud_t *FreeCloud(OicCloud_t *cloud)
         }
         OIC_LOG_V(DEBUG, TAG, "thread for cloud %s/%s is stopped", cloud->cis, cloud->apn);
     }
-    cloud->pid = 0;
 
     OicCloud_t *ret = cloud->next;
     cloud->next = NULL;
index cfbb375..ced509a 100644 (file)
@@ -84,8 +84,8 @@ static void DeleteCloudList(OicCloud_t *clouds, bool signout)
         {
             OCCloudSignOut(p1);
         }
-        FreeCloud(p1);
         LL_DELETE(clouds, p1);
+        FreeCloud(p1);
         p1 = NULL;
     }
     oc_mutex_unlock(gCloudMutex);
@@ -96,11 +96,13 @@ static void DeleteCloudList(OicCloud_t *clouds, bool signout)
 void StopClouds()
 {
     DeleteCloudList(gCloud, true);
+    gCloud = NULL;
 }
 
 void ResetClouds()
 {
     DeleteCloudList(gCloud, false);
+    gCloud = NULL;
 }
 
 void DeleteCloudAccount()