mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 23:42:58 +02:00
eitd: addEvent - fix possible segfault if lastEvent==NULL
This commit is contained in:
@@ -466,7 +466,7 @@ xprintf("addEvent: ch %012" PRIx64 " running %d (%s) got_CN %d\n", evt.get_chann
|
|||||||
#else
|
#else
|
||||||
time_t now = time(NULL);
|
time_t now = time(NULL);
|
||||||
bool back = false;
|
bool back = false;
|
||||||
if ((*lastEvent)->times.size() == 1)
|
if (*lastEvent!=NULL && (*lastEvent)->times.size() == 1)
|
||||||
{
|
{
|
||||||
if ((*lastEvent)->times.begin()->startzeit + (long)(*lastEvent)->times.begin()->dauer >= now - oldEventsAre)
|
if ((*lastEvent)->times.begin()->startzeit + (long)(*lastEvent)->times.begin()->dauer >= now - oldEventsAre)
|
||||||
back = true;
|
back = true;
|
||||||
@@ -489,7 +489,8 @@ xprintf("addEvent: ch %012" PRIx64 " running %d (%s) got_CN %d\n", evt.get_chann
|
|||||||
}
|
}
|
||||||
// else fprintf(stderr, ">");
|
// else fprintf(stderr, ">");
|
||||||
unlockEvents();
|
unlockEvents();
|
||||||
deleteEvent((*lastEvent)->uniqueKey());
|
if(*lastEvent!=NULL)
|
||||||
|
deleteEvent((*lastEvent)->uniqueKey());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
unlockEvents();
|
unlockEvents();
|
||||||
|
Reference in New Issue
Block a user