Fix memory leak on OCDoResource
authorErich Keane <erich.keane@intel.com>
Wed, 22 Jul 2015 18:31:42 +0000 (11:31 -0700)
committerErich Keane <erich.keane@intel.com>
Thu, 23 Jul 2015 18:15:08 +0000 (18:15 +0000)
OCDoResource was leaking the generated payload each time, so
this fixes the issue by ensuring it is free'd at the end.

Change-Id: I693318bdcb6d7baa37a5397fab33b0fe4c784960
Signed-off-by: Erich Keane <erich.keane@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1821
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
resource/csdk/stack/src/ocstack.c

index 6124337..3edd911 100644 (file)
@@ -2199,6 +2199,7 @@ exit:
 
     // This is the owner of the payload object, so we free it
     OCPayloadDestroy(payload);
+    OICFree(requestInfo.info.payload);
     OICFree(devAddr);
     OICFree(resourceUri);
     OICFree(resourceType);