[icecast-dev] Stream metadata settings

Michael Smith msmith at xiph.org
Mon Dec 1 16:38:01 PST 2003



> I just checked out a fresh copy of Icecast CVS and I'm getting pretty
> discouraged when I see that not even the bugfix for the double free bug is
> in there yet.
>
> diff -b -B -r -u -P --exclude-from=ignore ../icecast/src/source.c
> ./src/source.c
> --- ../icecast/src/source.c     Fri Nov 14 17:51:59 2003
> +++ ./src/source.c      Mon Dec  1 09:14:34 2003
> @@ -139,7 +192,6 @@
>   #endif
>
>       free(source->mount);
> -    free(source->fallback_mount);
>       client_destroy(source->client);
>       avl_tree_free(source->pending_tree, _free_client);
>       avl_tree_free(source->client_tree, _free_client);
>
>
> This is the patch and without it, anything using fallbacks will fail
> miserably. It is the prerequisite for almost all other patches, because
> this bug is a showstopper. Unless and until this patch is applied, all the
> others are useless.
>

Melanie,

Sorry about this one, I forgot about it. Your patch is incorrect, and will 
cause memory leaks - this has to be freed here. The bug is in how it is 
allocated to begin with.

We can't just remove this, because (as well as the source.c initialisation) it 
can be free(), and replaced by a newly allocated string, in admin.c.

So, this patch should work:

diff -u -r1.59 source.c
--- source.c	24 Jul 2003 16:21:22 -0000	1.59
+++ source.c	2 Dec 2003 00:36:56 -0000
@@ -72,7 +72,8 @@
     src->yp_public = 0;

     if(mountinfo != NULL) {
-        src->fallback_mount = mountinfo->fallback_mount;
+        if(mountinfo->fallback_mount)
+            src->fallback_mount = strdup(mountinfo->fallback_mount);
         src->max_listeners = mountinfo->max_listeners;
         src->dumpfilename = mountinfo->dumpfile;
     }

<p>Ok?

Mike

--- >8 ----
List archives:  http://www.xiph.org/archives/
icecast project homepage: http://www.icecast.org/
To unsubscribe from this list, send a message to 'icecast-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Icecast-dev mailing list