eEPGCache: Don't access iterator after erase
authorbetacentauri <betacentauri@arcor.de>
Sat, 16 May 2015 12:01:00 +0000 (14:01 +0200)
committerErik Slagter <erik@openpli.org>
Sat, 16 May 2015 17:55:48 +0000 (19:55 +0200)
This caused invalid read in valgrind
Problem is not completly solved because of still mutex_unlock use it.

Signed-off-by: Erik Slagter <erik@openpli.org>

lib/dvb/epgcache.cpp

index 5215bea..0fa2078 100644 (file)
@@ -621,10 +621,8 @@ void eEPGCache::DVBChannelStateChanged(iDVBChannel *chan)
                                                m_knownChannels.erase(it);
                                        }
                                        pthread_mutex_unlock(&it->second->channel_active);
-                                       delete it->second;
-                                       it->second = 0;
                                        // -> gotMessage -> abortEPG
-                                       break;
+                                       return;
                                }
                                default: // ignore all other events
                                        return;