[xiph-commits] r14018 - icecast/trunk/icecast/src

karl at svn.xiph.org karl at svn.xiph.org
Fri Oct 19 18:58:15 PDT 2007


Author: karl
Date: 2007-10-19 18:58:14 -0700 (Fri, 19 Oct 2007)
New Revision: 14018

Modified:
   icecast/trunk/icecast/src/auth_url.c
   icecast/trunk/icecast/src/cfgfile.c
Log:
fix some potential minor memory leaks


Modified: icecast/trunk/icecast/src/auth_url.c
===================================================================
--- icecast/trunk/icecast/src/auth_url.c	2007-10-20 01:55:18 UTC (rev 14017)
+++ icecast/trunk/icecast/src/auth_url.c	2007-10-20 01:58:14 UTC (rev 14018)
@@ -509,7 +509,7 @@
     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)

Modified: icecast/trunk/icecast/src/cfgfile.c
===================================================================
--- icecast/trunk/icecast/src/cfgfile.c	2007-10-20 01:55:18 UTC (rev 14017)
+++ icecast/trunk/icecast/src/cfgfile.c	2007-10-20 01:58:14 UTC (rev 14018)
@@ -723,6 +723,7 @@
         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 @@
             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 @@
             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);
         }



More information about the commits mailing list