summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2016-07-26 18:37:25 -0400
committerGitHub <noreply@github.com>2016-07-26 18:37:25 -0400
commit7b980422f8524de391e3e745f6a39d12a20fc82e (patch)
treee021dad155a6e61299c1c169f877bc62992b7d76 /src/components
parent408b16921c0ae327a5feb58749149ddffedcb226 (diff)
parentf95d608893b6a537ec2e7e753a6b162f067c1c01 (diff)
downloadsdl_core-7b980422f8524de391e3e745f6a39d12a20fc82e.tar.gz
Merge pull request #714 from BTPankow/hotfix/coverity_resource_leaks
Fix Coverity resource leaks (CIDs 80039, 80040)
Diffstat (limited to 'src/components')
-rw-r--r--src/components/config_profile/src/ini_file.cc3
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/components/config_profile/src/ini_file.cc b/src/components/config_profile/src/ini_file.cc
index 236dd1ae2b..5ec77d183b 100644
--- a/src/components/config_profile/src/ini_file.cc
+++ b/src/components/config_profile/src/ini_file.cc
@@ -186,15 +186,18 @@ char ini_write_value(const char *fname,
fd = mkstemp(temp_fname);
if (-1 == fd) {
+ fclose(rd_fp);
return FALSE;
}
wr_fp = fdopen(fd, "w");
if (NULL == wr_fp) {
unlink(temp_fname);
close(fd);
+ fclose(rd_fp);
return FALSE;
}
} else {
+ fclose(rd_fp);
return FALSE;
}
}
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc b/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc
index d6f9f26317..4240c9a3a4 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc
@@ -120,6 +120,7 @@ bool BluetoothSocketConnection::Establish(ConnectError** error) {
"Failed to Connect to remote device " << BluetoothDevice::GetUniqueDeviceId(
remoteSocketAddress.rc_bdaddr) << " for session " << this);
*error = new ConnectError();
+ close(rfcomm_socket);
LOG4CXX_TRACE(logger_, "exit with FALSE");
return false;
}