mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-02-02 15:07:36 -05:00
YP related cleanup, avoid bad pointer reference on HUP
svn path=/trunk/icecast/; revision=5829
This commit is contained in:
parent
5574d519c9
commit
012b3f4246
@ -134,6 +134,7 @@ void curl_shutdown()
|
|||||||
curl_easy_cleanup(curl_connections[i].curl_handle);
|
curl_easy_cleanup(curl_connections[i].curl_handle);
|
||||||
memset(&(curl_connections[i]), 0, sizeof(curl_connections[i]));
|
memset(&(curl_connections[i]), 0, sizeof(curl_connections[i]));
|
||||||
}
|
}
|
||||||
|
curl_global_cleanup();
|
||||||
}
|
}
|
||||||
int curl_get_connection()
|
int curl_get_connection()
|
||||||
{
|
{
|
||||||
|
@ -344,7 +344,7 @@ void *source_main(void *arg)
|
|||||||
if (config->yp_url[i]) {
|
if (config->yp_url[i]) {
|
||||||
source->ypdata[source->num_yp_directories] = yp_create_ypdata();
|
source->ypdata[source->num_yp_directories] = yp_create_ypdata();
|
||||||
source->ypdata[source->num_yp_directories]->yp_url =
|
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 =
|
source->ypdata[source->num_yp_directories]->yp_url_timeout =
|
||||||
config->yp_url_timeout[i];
|
config->yp_url_timeout[i];
|
||||||
source->ypdata[source->num_yp_directories]->yp_touch_interval = 0;
|
source->ypdata[source->num_yp_directories]->yp_touch_interval = 0;
|
||||||
|
3
src/yp.c
3
src/yp.c
@ -434,6 +434,9 @@ ypdata_t *yp_create_ypdata()
|
|||||||
void yp_destroy_ypdata(ypdata_t *ypdata)
|
void yp_destroy_ypdata(ypdata_t *ypdata)
|
||||||
{
|
{
|
||||||
if (ypdata) {
|
if (ypdata) {
|
||||||
|
if (ypdata->yp_url) {
|
||||||
|
free(ypdata->yp_url);
|
||||||
|
}
|
||||||
if (ypdata->sid) {
|
if (ypdata->sid) {
|
||||||
free(ypdata->sid);
|
free(ypdata->sid);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user