Commit 486fa260 authored by Sudarsana Nagineni's avatar Sudarsana Nagineni Committed by Gabriel Schulhof

Bindings: Fix memory leaks in OCSetDeviceInfo and platformInfo

Fix leaks in OCSetDeviceInfo by freeing all the members
of OCDeviceInfo.

Fix a leak in platformInfo by removing duplicate assignment
of platformID.

Closes gh-71
Closes gh-72

Change-Id: If4fb7da8b2ecf36ef6c0348067b5719ae849cce2
Signed-off-by: default avatarSudarsana Nagineni <sudarsana.nagineni@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/11067Reviewed-by: default avatarGabriel Schulhof <gabriel.schulhof@intel.com>
Tested-by: default avatarGabriel Schulhof <gabriel.schulhof@intel.com>
parent d3f00f51
......@@ -66,7 +66,7 @@ NAN_METHOD(bind_OCSetDeviceInfo) {
OCStackResult result = OCSetDeviceInfo(deviceInfo);
free(deviceInfo.deviceName);
c_OCDeviceInfoFreeMembers(&deviceInfo);
info.GetReturnValue().Set(Nan::New(result));
}
......
......@@ -60,8 +60,6 @@ void c_OCPlatformInfoFreeMembers(OCPlatformInfo *info) {
bool c_OCPlatformInfo(Local<Object> platformInfo, OCPlatformInfo *info) {
OCPlatformInfo local = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
VALIDATE_AND_ASSIGN_STRING(&local, platformID, platformInfo,
c_OCPlatformInfoFreeMembers, false);
VALIDATE_AND_ASSIGN_STRING(&local, platformID, platformInfo,
c_OCPlatformInfoFreeMembers, false);
VALIDATE_AND_ASSIGN_STRING(&local, manufacturerName, platformInfo,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment