Commit 1d5c1ebd authored by Karl Heyes's avatar Karl Heyes

fix double free bug with failed to start relays and add a guard on refbuf release

svn path=/icecast/trunk/icecast/; revision=9859
parent a4b03ad2
......@@ -66,6 +66,8 @@ void refbuf_addref(refbuf_t *self)
void refbuf_release(refbuf_t *self)
{
if (self == NULL)
return;
self->_count--;
if (self->_count == 0) {
while (self->associated)
......@@ -76,7 +78,6 @@ void refbuf_release(refbuf_t *self)
}
free(self->data);
free(self);
return;
}
}
......@@ -243,9 +243,10 @@ static void *start_relay_stream (void *arg)
/* 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 @@ static void *start_relay_stream (void *arg)
avl_tree_unlock (global.source_tree);
}
if (con == NULL && streamsock != SOCK_ERROR)
sock_close (streamsock);
if (con)
connection_close (con);
src->con = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment