From: Romain Forlot Date: Thu, 1 Jun 2017 13:58:44 +0000 (+0200) Subject: Delete pointer and content, possible memory leak X-Git-Tag: 5.0.2~128 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=e7864bd53878176fd7855d31e9141bd09efc33ad;p=apps%2Fagl-service-can-low-level.git Delete pointer and content, possible memory leak Change-Id: I21e65bcaaa444c03bbc634f1d437e6ff363623b6 Signed-off-by: Romain Forlot --- diff --git a/CAN-binder/low-can-binding/diagnostic/diagnostic-manager.cpp b/CAN-binder/low-can-binding/diagnostic/diagnostic-manager.cpp index 826d26ba..8ed8a787 100644 --- a/CAN-binder/low-can-binding/diagnostic/diagnostic-manager.cpp +++ b/CAN-binder/low-can-binding/diagnostic/diagnostic-manager.cpp @@ -458,6 +458,11 @@ active_diagnostic_request_t* diagnostic_manager_t::add_recurring_request(Diagnos entry->set_handle(shims_, request); if(create_rx_filter(OBD2_FUNCTIONAL_BROADCAST_ID, frequencyHz) < 0) + { + recurring_requests_.pop_back(); + delete entry; + entry = nullptr; + } else { start_diagnostic_request(&shims_, entry->get_handle());