From a5d75feb12a17a75e91474a006cb6038e4e1a1e0 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 9 May 2019 20:56:14 +0200 Subject: [PATCH] PMT_CHANGED: fix use after delete Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d05d4a88fb414f76a27c00292d2fbb9ee2d90353 Author: Jacek Jendrzej Date: 2019-05-09 (Thu, 09 May 2019) --- src/driver/rcinput.cpp | 1 + src/neutrino.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index f336b488e..c9059d7e6 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -1145,6 +1145,7 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 case CZapitClient::EVT_PMT_CHANGED: *msg = NeutrinoMessages::EVT_PMT_CHANGED; *data = (neutrino_msg_data_t) p; + dont_delete_p = true; break; case CZapitClient::EVT_TUNE_COMPLETE: *msg = NeutrinoMessages::EVT_TUNE_COMPLETE; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index bcfe0e2a3..f5caef7f0 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3932,6 +3932,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) else if( msg == NeutrinoMessages::EVT_PMT_CHANGED) { t_channel_id channel_id = *(t_channel_id*) data; CRecordManager::getInstance()->Update(channel_id); + delete[] (unsigned char*) data; return messages_return::handled; }