aboutsummaryrefslogtreecommitdiffstats
path: root/CAN-binder/low-can-binding/diagnostic/active-diagnostic-request.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-05-24 00:46:43 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-05-24 00:46:43 +0200
commitab4d52b65359c571267c71244578321580520c20 (patch)
tree557895b576e234b0342807aa64971577b22687d1 /CAN-binder/low-can-binding/diagnostic/active-diagnostic-request.cpp
parentd35da77dcd5273b54177f8bc8ae7e5992bb3ca09 (diff)
Fix memory leaks
Change-Id: I4a33b6d5f1f3b73af113aff62b024329b0ed5288 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/low-can-binding/diagnostic/active-diagnostic-request.cpp')
-rw-r--r--CAN-binder/low-can-binding/diagnostic/active-diagnostic-request.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/CAN-binder/low-can-binding/diagnostic/active-diagnostic-request.cpp b/CAN-binder/low-can-binding/diagnostic/active-diagnostic-request.cpp
index e9f0cd10..35a6c562 100644
--- a/CAN-binder/low-can-binding/diagnostic/active-diagnostic-request.cpp
+++ b/CAN-binder/low-can-binding/diagnostic/active-diagnostic-request.cpp
@@ -82,6 +82,13 @@ active_diagnostic_request_t::active_diagnostic_request_t(const std::string& bus,
timeout_clock_{frequency_clock_t(10)}
{}
+active_diagnostic_request_t::~active_diagnostic_request_t()
+{
+ socket_.close();
+ delete handle_;
+ handle_ = nullptr;
+}
+
uint32_t active_diagnostic_request_t::get_id() const
{
return id_;