From ab4d52b65359c571267c71244578321580520c20 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Wed, 24 May 2017 00:46:43 +0200 Subject: Fix memory leaks Change-Id: I4a33b6d5f1f3b73af113aff62b024329b0ed5288 Signed-off-by: Romain Forlot --- CAN-binder/low-can-binding/binding/low-can-cb.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'CAN-binder/low-can-binding/binding') diff --git a/CAN-binder/low-can-binding/binding/low-can-cb.cpp b/CAN-binder/low-can-binding/binding/low-can-cb.cpp index 9e85f5c7..0dcff1df 100644 --- a/CAN-binder/low-can-binding/binding/low-can-cb.cpp +++ b/CAN-binder/low-can-binding/binding/low-can-cb.cpp @@ -50,6 +50,8 @@ void on_no_clients(std::string message) if( adr != nullptr) configuration_t::instance().get_diagnostic_manager().cleanup_request(adr, true); } + delete diag_req; + diag_req = nullptr; } static void push_n_notify(const can_message_t& cm) @@ -207,6 +209,8 @@ static int subscribe_unsubscribe_signals(struct afb_req request, bool subscribe, diag_m.cleanup_request( diag_m.find_recurring_request(diag_req), true); WARNING(binder_interface, "%s: signal: %s isn't supported. Canceling operation.", __FUNCTION__, sig->get_name().c_str()); + delete diag_req; + diag_req = nullptr; return -1; } -- cgit