summaryrefslogtreecommitdiffstats
path: root/low-can-binding/diagnostic
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-12-07 17:17:43 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2018-12-14 08:59:54 +0000
commit97a08a7e37835f0e8619d22c83243bee26a2bff2 (patch)
tree66a44a6c977c9fe16311ec031204cb82aa84e6ca /low-can-binding/diagnostic
parente190b7b3069d86fce25831c366bb0cd3fa615289 (diff)
Smalls improvements
- Improve robustness reading a BCM socket Adding checks on system calls and remove the initialization of the struct that will hold the received message, not so much needed in that case. - More accurate log message at subscription/unsubscription step whether this is a FD CAN messages or not and if this a subscription or an unsubscription that is requested. - Initialize the full struct of vehicle message to avoid memory warning about conditionnal jump based on uninitialized bytes. - Memleak: Free raw pointer on active diagnostic requests Change-Id: I4bbf4d851c0fa1efdb6fa6034fac3d1dcafa1a73 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'low-can-binding/diagnostic')
-rw-r--r--low-can-binding/diagnostic/diagnostic-manager.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/low-can-binding/diagnostic/diagnostic-manager.cpp b/low-can-binding/diagnostic/diagnostic-manager.cpp
index ba4b0c87..55e61084 100644
--- a/low-can-binding/diagnostic/diagnostic-manager.cpp
+++ b/low-can-binding/diagnostic/diagnostic-manager.cpp
@@ -188,6 +188,8 @@ void diagnostic_manager_t::find_and_erase(active_diagnostic_request_t* entry, st
void diagnostic_manager_t::cancel_request(active_diagnostic_request_t* entry)
{
entry->get_socket().close();
+ if(entry->get_handle())
+ delete(entry->get_handle());
delete entry;
entry = nullptr;
}