Merge branch 'master' into easysetup & CBOR changes
[contrib/iotivity.git] / resource / csdk / stack / src / ocstack.c
index f34cf8c..f6f43e5 100644 (file)
@@ -1855,6 +1855,8 @@ static OCStackResult ParseRequestUri(const char *fullUri,
             }
         }
 
+        da = (OCDevAddr *)OICCalloc(1, sizeof (OCDevAddr));
+
         len = end - start;
         if (len >= sizeof(da->addr))
         {
@@ -1862,6 +1864,7 @@ static OCStackResult ParseRequestUri(const char *fullUri,
         }
 
         da = (OCDevAddr *)OICCalloc(sizeof (OCDevAddr), 1);
+
         if (!da)
         {
             return OC_STACK_NO_MEMORY;