changeset 1441:ed80e946f30b trunk

[svn] - ok, don't eat up all the system ram (I forgot to g_free())
author nenolod
date Fri, 28 Jul 2006 01:05:21 -0700
parents acdc12679d1a
children 5b44358151f8
files ChangeLog libaudacious/beepctrl.c
diffstat 2 files changed, 20 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Jul 28 00:49:14 2006 -0700
+++ b/ChangeLog	Fri Jul 28 01:05:21 2006 -0700
@@ -1,3 +1,12 @@
+2006-07-28 07:49:14 +0000  William Pitcock <nenolod@nenolod.net>
+  revision [1794]
+  - allow environment variable AUDTOOL_REMOTE_URI to influence where the client library accesses the audacious session
+  
+
+  Changes:        Modified:
+  +4 -0           trunk/audtool/audtool.c  
+
+
 2006-07-28 07:46:34 +0000  William Pitcock <nenolod@nenolod.net>
   revision [1792]
   - i believe we've got it!
--- a/libaudacious/beepctrl.c	Fri Jul 28 00:49:14 2006 -0700
+++ b/libaudacious/beepctrl.c	Fri Jul 28 01:05:21 2006 -0700
@@ -357,11 +357,11 @@
     keybuf = strchr(tmp, '/');
     *keybuf++ = '\0';
 
-    *key = keybuf;
+    *key = g_strdup(keybuf);
 
     if (strchr(workbuf, ':') == NULL)
     {
-        *host = workbuf;
+        *host = g_strdup(workbuf);
         *port = 37370 + session;
     }
     else
@@ -371,6 +371,8 @@
 
         *port = iport + session;
     }
+
+    g_free(in);
 }
 
 /* unix://localhost/tmp/audacious_nenolod.0 */
@@ -387,7 +389,9 @@
     keybuf = strchr(tmp, '/');
     *keybuf++ = '\0';
 
-    *key = keybuf;
+    *key = g_strdup(keybuf);
+
+    g_free(in);
 }
 
 gint
@@ -413,6 +417,7 @@
 	    audacious_decode_unix_uri(session, uri, &path);
 
 	    g_strlcpy(saddr.sun_path, path, 108);
+            g_free(path);
             setreuid(stored_uid, euid);
             if (connect(fd, (struct sockaddr *) &saddr, sizeof(saddr)) != -1)
                 return fd;
@@ -441,6 +446,9 @@
             saddr.sin_port = htons(port);
             memcpy(&saddr.sin_addr, hp->h_addr, hp->h_length);
 
+            g_free(host);
+            g_free(key);
+
             if (connect(fd, (struct sockaddr *) &saddr, sizeof(saddr)) != -1)
                 return fd;
         }