[xiph-commits] r9859 - icecast/trunk/icecast/src

karl at svn.xiph.org karl at svn.xiph.org
Sun Aug 28 18:16:05 PDT 2005


Author: karl
Date: 2005-08-28 18:16:02 -0700 (Sun, 28 Aug 2005)
New Revision: 9859

Modified:
   icecast/trunk/icecast/src/refbuf.c
   icecast/trunk/icecast/src/slave.c
Log:
fix double free bug with failed to start relays and add a guard on refbuf release


Modified: icecast/trunk/icecast/src/refbuf.c
===================================================================
--- icecast/trunk/icecast/src/refbuf.c	2005-08-28 15:05:55 UTC (rev 9858)
+++ icecast/trunk/icecast/src/refbuf.c	2005-08-29 01:16:02 UTC (rev 9859)
@@ -66,6 +66,8 @@
 
 void refbuf_release(refbuf_t *self)
 {
+    if (self == NULL)
+        return;
     self->_count--;
     if (self->_count == 0) {
         while (self->associated)
@@ -76,7 +78,6 @@
         }
         free(self->data);
         free(self);
-        return;
     }
 }
 

Modified: icecast/trunk/icecast/src/slave.c
===================================================================
--- icecast/trunk/icecast/src/slave.c	2005-08-28 15:05:55 UTC (rev 9858)
+++ icecast/trunk/icecast/src/slave.c	2005-08-29 01:16:02 UTC (rev 9859)
@@ -243,9 +243,10 @@
             /* make sure only the client_destory frees these */
             con = NULL;
             parser = NULL;
-            streamsock = SOCK_ERROR;
             break;
         }
+        con = NULL;
+        parser = NULL;
         client_set_queue (src->client, NULL);
 
         if (connection_complete_source (src, 0) < 0)
@@ -286,8 +287,6 @@
         avl_tree_unlock (global.source_tree);
     }
 
-    if (con == NULL && streamsock != SOCK_ERROR)
-        sock_close (streamsock);
     if (con)
         connection_close (con);
     src->con = NULL;



More information about the commits mailing list