1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -05:00

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

svn path=/icecast/trunk/icecast/; revision=9859
This commit is contained in:
Karl Heyes 2005-08-29 01:16:02 +00:00
parent a4b03ad26c
commit 1d5c1ebdd6
2 changed files with 4 additions and 4 deletions

View File

@ -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;
}
}

View File

@ -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;