]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
channels: fix list remove for epg linked channels (see #4134)
authorJaroslav Kysela <perex@perex.cz>
Sun, 18 Dec 2016 20:23:10 +0000 (21:23 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sun, 18 Dec 2016 20:23:10 +0000 (21:23 +0100)
src/channels.c

index 11d9a35dd62687aaf2d3ed0ca64ac4562df9e5b7..b483ab64501566ac2184d2be8a4f2e6440556023 100644 (file)
@@ -1062,13 +1062,13 @@ channel_delete ( channel_t *ch, int delconf )
   epggrab_channel_rem(ch);
   epg_channel_unlink(ch);
   if (ch->ch_epg_parent) {
-    LIST_REMOVE(ch, ch_epg_slave_link);
+    LIST_SAFE_REMOVE(ch, ch_epg_slave_link);
     free(ch->ch_epg_parent);
     ch->ch_epg_parent = NULL;
   }
   for (ch1 = LIST_FIRST(&ch->ch_epg_slaves); ch1; ch1 = ch2) {
     ch2 = LIST_NEXT(ch1, ch_epg_slave_link);
-    LIST_REMOVE(ch1, ch_epg_slave_link);
+    LIST_SAFE_REMOVE(ch1, ch_epg_slave_link);
     if (delconf) {
       free(ch1->ch_epg_parent);
       ch1->ch_epg_parent = NULL;