Fix memory leak in sample app for linux
authorSatya Prakash Gupta <sp.gupta@samsung.com>
Thu, 18 Jun 2015 10:12:55 +0000 (15:42 +0530)
committerErich Keane <erich.keane@intel.com>
Thu, 18 Jun 2015 16:38:14 +0000 (16:38 +0000)
memory free applied in leakage areas

Change-Id: I34e356ff3ff5abb0072a15c526b2b37827d5b676
Signed-off-by: Satya Prakash Gupta <sp.gupta@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1341
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Erich Keane <erich.keane@intel.com>
resource/csdk/connectivity/samples/linux/sample_main.c

index c46b42f..0bc9051 100644 (file)
@@ -983,6 +983,7 @@ void request_handler(const CAEndpoint_t *object, const CARequestInfo_t *requestI
                                                  object->port, &endpoint))
             {
                 printf("Failed to create duplicate of remote endpoint!\n");
+                free(uri);
                 return;
             }
             endpoint->flags = CA_SECURE;
@@ -1371,6 +1372,7 @@ void parsing_coap_uri(const char* uri, addressSet_t* address)
         free(cloneUri);
         return;
     }
+    free(cloneUri);
     return;
 }