Fix Unicast Presence Error
authoromkar <omkar.m.hegde@intel.com>
Mon, 8 Dec 2014 22:32:28 +0000 (14:32 -0800)
committeromkar <omkar.m.hegde@intel.com>
Mon, 8 Dec 2014 22:32:58 +0000 (14:32 -0800)
Fix for IOT-95. Previously we had missed a "+1" when mallocing a char *

Change-Id: I96021ddce22c2fa7e3afa8f8d10e6da10b47ebbc
Signed-off-by: omkar <omkar.m.hegde@intel.com>
resource/csdk/stack/src/ocstack.c

index 14da26ab2680425205b82976eabe16fcc68056e6..e6080c9fcaddd8dccd5311e68ddadd07ada2aa97 100644 (file)
@@ -2350,7 +2350,7 @@ OCStackResult getResourceType(const char * uri, unsigned char** resourceType, ch
         return OC_STACK_INVALID_PARAM;
     }
     char * leftToken = NULL;
-    char * tempURI = (char *) OCMalloc(strlen(uri));
+    char * tempURI = (char *) OCMalloc(strlen(uri) + 1);
     if(!tempURI)
     {
         goto exit;