Commit 012b3f42 authored by Karl Heyes's avatar Karl Heyes

YP related cleanup, avoid bad pointer reference on HUP

svn path=/trunk/icecast/; revision=5829
parent 5574d519
......@@ -134,6 +134,7 @@ void curl_shutdown()
curl_easy_cleanup(curl_connections[i].curl_handle);
memset(&(curl_connections[i]), 0, sizeof(curl_connections[i]));
}
curl_global_cleanup();
}
int curl_get_connection()
{
......
......@@ -344,7 +344,7 @@ void *source_main(void *arg)
if (config->yp_url[i]) {
source->ypdata[source->num_yp_directories] = yp_create_ypdata();
source->ypdata[source->num_yp_directories]->yp_url =
config->yp_url[i];
strdup (config->yp_url[i]);
source->ypdata[source->num_yp_directories]->yp_url_timeout =
config->yp_url_timeout[i];
source->ypdata[source->num_yp_directories]->yp_touch_interval = 0;
......
......@@ -434,6 +434,9 @@ ypdata_t *yp_create_ypdata()
void yp_destroy_ypdata(ypdata_t *ypdata)
{
if (ypdata) {
if (ypdata->yp_url) {
free(ypdata->yp_url);
}
if (ypdata->sid) {
free(ypdata->sid);
}
......
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