From 3f67f957539b930eb74c60dda85c407ed924817b Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 21 Apr 2016 16:59:51 +0200 Subject: [PATCH] avoid pssible memleak Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8d1e34a527801fcce935ad400f0f274d56cc431c Author: Jacek Jendrzej Date: 2016-04-21 (Thu, 21 Apr 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/colorgradient.cpp | 4 +++- src/driver/rcinput.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/driver/colorgradient.cpp b/src/driver/colorgradient.cpp index e9ed0e97e..ee8e91150 100644 --- a/src/driver/colorgradient.cpp +++ b/src/driver/colorgradient.cpp @@ -142,8 +142,10 @@ fb_pixel_t* CColorGradient::gradientOneColor(fb_pixel_t col, fb_pixel_t *gradien start_v = max_v; end_v = min_v; break; - default: + default:{ + free(gradientBuf); return 0; + } } int bSize1 = ((mode == gradientDark2Light2Dark) || (mode == gradientLight2Dark2Light)) ? bSize/2 : bSize; diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 1954fbdb0..65856a9fe 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -1183,7 +1183,7 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 case NeutrinoMessages::EVT_NEXTEPG: { CSectionsdClient::CurrentNextInfo *cn = (CSectionsdClient::CurrentNextInfo *) p; - delete cn; + delete [] cn; p = NULL; break; }