Commit a26bb500 authored by Karl Heyes's avatar Karl Heyes

fix some potential minor memory leaks

svn path=/icecast/trunk/icecast/; revision=14018
parent 549127b9
......@@ -509,7 +509,7 @@ int auth_get_url_auth (auth_t *authenticator, config_options_t *options)
url_info->handle = curl_easy_init ();
if (url_info->handle == NULL)
{
free (url_info);
auth_url_clear (authenticator);
return -1;
}
if (url_info->auth_header)
......
......@@ -723,6 +723,7 @@ static void _parse_relay(xmlDocPtr doc, xmlNodePtr node,
if (xmlIsBlankNode(node)) continue;
if (xmlStrcmp (node->name, XMLSTR("server")) == 0) {
if (relay->server) xmlFree (relay->server);
relay->server = (char *)xmlNodeListGetString(
doc, node->xmlChildrenNode, 1);
}
......@@ -732,10 +733,12 @@ static void _parse_relay(xmlDocPtr doc, xmlNodePtr node,
if(tmp) xmlFree(tmp);
}
else if (xmlStrcmp (node->name, XMLSTR("mount")) == 0) {
if (relay->mount) xmlFree (relay->mount);
relay->mount = (char *)xmlNodeListGetString(
doc, node->xmlChildrenNode, 1);
}
else if (xmlStrcmp (node->name, XMLSTR("local-mount")) == 0) {
if (relay->localmount) xmlFree (relay->localmount);
relay->localmount = (char *)xmlNodeListGetString(
doc, node->xmlChildrenNode, 1);
}
......@@ -745,10 +748,12 @@ static void _parse_relay(xmlDocPtr doc, xmlNodePtr node,
if(tmp) xmlFree(tmp);
}
else if (xmlStrcmp (node->name, XMLSTR("username")) == 0) {
if (relay->username) xmlFree (relay->username);
relay->username = (char *)xmlNodeListGetString(doc,
node->xmlChildrenNode, 1);
}
else if (xmlStrcmp (node->name, XMLSTR("password")) == 0) {
if (relay->password) xmlFree (relay->password);
relay->password = (char *)xmlNodeListGetString(doc,
node->xmlChildrenNode, 1);
}
......
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