[MPlayer-cvslog] r37667 - trunk/stream/stream_radio.c

reimar subversion at mplayerhq.hu
Wed Feb 10 23:21:38 CET 2016


Author: reimar
Date: Wed Feb 10 23:21:38 2016
New Revision: 37667

Log:
stream_radio: fix incorrect free.

Do not delete the only element if the channel
list contains only one entry.
Fixes a use-after-free later that Coverity
warns about.

Modified:
   trunk/stream/stream_radio.c

Modified: trunk/stream/stream_radio.c
==============================================================================
--- trunk/stream/stream_radio.c	Wed Feb 10 23:16:57 2016	(r37666)
+++ trunk/stream/stream_radio.c	Wed Feb 10 23:21:38 2016	(r37667)
@@ -211,9 +211,10 @@ static int parse_channels(radio_priv_t*
             priv->radio_channel_current->next->next = NULL;
             priv->radio_channel_current = priv->radio_channel_current->next;
         }
-        if (priv->radio_channel_current->prev)
+        if (priv->radio_channel_current->prev) {
             priv->radio_channel_current->prev->next = NULL;
-        free(priv->radio_channel_current);
+            free(priv->radio_channel_current);
+        }
 
         if (freq_channel)
             channel = freq_channel;


More information about the MPlayer-cvslog mailing list