Commit 518ec953 authored by Philipp Schafft's avatar Philipp Schafft 🦁

fixed(?) a memory leak: lost headers of stream because of wrong ref counter in...

fixed(?) a memory leak: lost headers of stream because of wrong ref counter in associated refbuf objects. I HATE refbuf.

svn path=/icecast/trunk/icecast/; revision=19054
parent c9b6d627
......@@ -121,7 +121,6 @@ void format_ogg_free_headers (ogg_state_t *ogg_info)
{
refbuf_t *to_release = header;
header = header->next;
to_release->next = NULL;
refbuf_release (to_release);
}
ogg_info->header_pages = NULL;
......
......@@ -70,11 +70,12 @@ static void refbuf_release_associated (refbuf_t *ref)
{
if (ref == NULL)
return;
while (ref && ref->_count == 1)
while (ref)
{
refbuf_t *to_go = ref;
ref = to_go->next;
to_go->next = NULL;
if ( to_go->_count == 1 )
to_go->next = NULL;
refbuf_release (to_go);
}
}
......@@ -88,7 +89,7 @@ void refbuf_release(refbuf_t *self)
{
refbuf_release_associated (self->associated);
if (self->next)
DEBUG0 ("next not null");
ERROR0 ("next not null");
free(self->data);
free(self);
}
......
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