summaryrefslogtreecommitdiffstats
path: root/low-can-binding/utils
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-12-21 13:45:58 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-12-21 13:45:58 +0100
commit3fe9374a579ce30f5022d81dd2cba30ed408662d (patch)
treeb78231b3a10871d6c263b718c93f84218012f4ef /low-can-binding/utils
parent9cb8f9e5578945b552a6f9b5d3aaaf7794d680d9 (diff)
Code enhancements mem leaks and uninitialized byteeel_4.99.5eel/4.99.54.99.5
Change-Id: I40632b6212118278f5877957a480122e9383e3bc Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'low-can-binding/utils')
-rw-r--r--low-can-binding/utils/socketcan.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/low-can-binding/utils/socketcan.cpp b/low-can-binding/utils/socketcan.cpp
index 71588a6..b943d1d 100644
--- a/low-can-binding/utils/socketcan.cpp
+++ b/low-can-binding/utils/socketcan.cpp
@@ -29,7 +29,9 @@ namespace utils
/// @brief Construct a default, invalid, socket.
socketcan_t::socketcan_t()
: socket_{INVALID_SOCKET}
- {}
+ {
+ ::memset(&tx_address_, 0, sizeof(tx_address_));
+ }
/// @brief Construct a socket by moving an existing one.
socketcan_t::socketcan_t(socketcan_t&& s)
@@ -94,4 +96,4 @@ namespace utils
{
return socket_;
}
-} \ No newline at end of file
+}