Commit b795bb58 authored by Karl Heyes's avatar Karl Heyes

cleanup bad pointer access after config re-read

svn path=/trunk/icecast/; revision=5673
parent 85efc9a7
...@@ -442,7 +442,6 @@ int connection_create_source(client_t *client, connection_t *con, http_parser_t ...@@ -442,7 +442,6 @@ int connection_create_source(client_t *client, connection_t *con, http_parser_t
config = config_get_config(); config = config_get_config();
mountproxy = config->mounts; mountproxy = config->mounts;
thread_mutex_lock(&(config_locks()->mounts_lock)); thread_mutex_lock(&(config_locks()->mounts_lock));
config_release_config();
while(mountproxy) { while(mountproxy) {
if(!strcmp(mountproxy->mountname, mount)) { if(!strcmp(mountproxy->mountname, mount)) {
...@@ -459,6 +458,7 @@ int connection_create_source(client_t *client, connection_t *con, http_parser_t ...@@ -459,6 +458,7 @@ int connection_create_source(client_t *client, connection_t *con, http_parser_t
if (format == FORMAT_ERROR) { if (format == FORMAT_ERROR) {
WARN1("Content-type \"%s\" not supported, dropping source", contenttype); WARN1("Content-type \"%s\" not supported, dropping source", contenttype);
thread_mutex_unlock(&(config_locks()->mounts_lock)); thread_mutex_unlock(&(config_locks()->mounts_lock));
config_release_config();
goto fail; goto fail;
} else { } else {
source = source_create(client, con, parser, mount, source = source_create(client, con, parser, mount,
...@@ -471,6 +471,7 @@ int connection_create_source(client_t *client, connection_t *con, http_parser_t ...@@ -471,6 +471,7 @@ int connection_create_source(client_t *client, connection_t *con, http_parser_t
source = source_create(client, con, parser, mount, format, mountinfo); source = source_create(client, con, parser, mount, format, mountinfo);
thread_mutex_unlock(&(config_locks()->mounts_lock)); thread_mutex_unlock(&(config_locks()->mounts_lock));
} }
config_release_config();
source->send_return = 1; source->send_return = 1;
source->shutdown_rwlock = &_source_shutdown_rwlock; source->shutdown_rwlock = &_source_shutdown_rwlock;
......
...@@ -72,9 +72,9 @@ source_t *source_create(client_t *client, connection_t *con, ...@@ -72,9 +72,9 @@ source_t *source_create(client_t *client, connection_t *con,
src->yp_public = 0; src->yp_public = 0;
if(mountinfo != NULL) { if(mountinfo != NULL) {
src->fallback_mount = mountinfo->fallback_mount; src->fallback_mount = strdup (mountinfo->fallback_mount);
src->max_listeners = mountinfo->max_listeners; src->max_listeners = mountinfo->max_listeners;
src->dumpfilename = mountinfo->dumpfile; src->dumpfilename = strdup (mountinfo->dumpfile);
} }
if(src->dumpfilename != NULL) { if(src->dumpfilename != NULL) {
...@@ -140,6 +140,7 @@ int source_free_source(void *key) ...@@ -140,6 +140,7 @@ int source_free_source(void *key)
free(source->mount); free(source->mount);
free(source->fallback_mount); free(source->fallback_mount);
free(source->dumpfilename);
client_destroy(source->client); client_destroy(source->client);
avl_tree_free(source->pending_tree, _free_client); avl_tree_free(source->pending_tree, _free_client);
avl_tree_free(source->client_tree, _free_client); avl_tree_free(source->client_tree, _free_client);
......
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