1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-09-29 04:25:55 -04:00

Handle missing mount in relay case, and add checks for NULL which may be an issue for libxml2.

svn path=/icecast/trunk/icecast/; revision=14430
This commit is contained in:
Karl Heyes 2008-01-24 03:31:25 +00:00
parent 4aa2f1e0eb
commit 22654d271c

View File

@ -119,30 +119,30 @@ static void config_clear_mount (mount_proxy *mount)
{ {
config_options_t *option; config_options_t *option;
xmlFree (mount->mountname); if (mount->mountname) xmlFree (mount->mountname);
xmlFree (mount->username); if (mount->username) xmlFree (mount->username);
xmlFree (mount->password); if (mount->password) xmlFree (mount->password);
xmlFree (mount->dumpfile); if (mount->dumpfile) xmlFree (mount->dumpfile);
xmlFree (mount->intro_filename); if (mount->intro_filename) xmlFree (mount->intro_filename);
xmlFree (mount->on_connect); if (mount->on_connect) xmlFree (mount->on_connect);
xmlFree (mount->on_disconnect); if (mount->on_disconnect) xmlFree (mount->on_disconnect);
xmlFree (mount->fallback_mount); if (mount->fallback_mount) xmlFree (mount->fallback_mount);
xmlFree (mount->stream_name); if (mount->stream_name) xmlFree (mount->stream_name);
xmlFree (mount->stream_description); if (mount->stream_description) xmlFree (mount->stream_description);
xmlFree (mount->stream_url); if (mount->stream_url) xmlFree (mount->stream_url);
xmlFree (mount->stream_genre); if (mount->stream_genre) xmlFree (mount->stream_genre);
xmlFree (mount->bitrate); if (mount->bitrate) xmlFree (mount->bitrate);
xmlFree (mount->type); if (mount->type) xmlFree (mount->type);
xmlFree (mount->charset); if (mount->charset) xmlFree (mount->charset);
xmlFree (mount->cluster_password); if (mount->cluster_password) xmlFree (mount->cluster_password);
xmlFree (mount->auth_type); if (mount->auth_type) xmlFree (mount->auth_type);
option = mount->auth_options; option = mount->auth_options;
while (option) while (option)
{ {
config_options_t *nextopt = option->next; config_options_t *nextopt = option->next;
xmlFree (option->name); if (option->name) xmlFree (option->name);
xmlFree (option->value); if (option->value) xmlFree (option->value);
free (option); free (option);
option = nextopt; option = nextopt;
} }
@ -729,6 +729,7 @@ static void _parse_relay(xmlDocPtr doc, xmlNodePtr node,
relay->next = NULL; relay->next = NULL;
relay->mp3metadata = 1; relay->mp3metadata = 1;
relay->on_demand = configuration->on_demand; relay->on_demand = configuration->on_demand;
relay->mount = (char *)xmlCharStrdup ("/");
do { do {
if (node == NULL) break; if (node == NULL) break;