changeset 1448:3b1c464cbbb0 trunk

[svn] Seems safer to me to free this way, assuming I'm not misreading. Hey. At least it doesn't crash.
author nemo
date Fri, 28 Jul 2006 07:21:20 -0700
parents 7ca5bef8d9ee
children a69db3a15bf2
files ChangeLog libaudacious/beepctrl.c
diffstat 2 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Jul 28 02:27:19 2006 -0700
+++ b/ChangeLog	Fri Jul 28 07:21:20 2006 -0700
@@ -1,3 +1,12 @@
+2006-07-28 09:27:19 +0000  William Pitcock <nenolod@nenolod.net>
+  revision [1808]
+  - fix invalid frees
+  
+
+  Changes:        Modified:
+  +2 -2           trunk/libaudacious/beepctrl.c  
+
+
 2006-07-28 09:19:18 +0000  William Pitcock <nenolod@nenolod.net>
   revision [1806]
   - be more paranoid about NULL pointers
--- a/libaudacious/beepctrl.c	Fri Jul 28 02:27:19 2006 -0700
+++ b/libaudacious/beepctrl.c	Fri Jul 28 07:21:20 2006 -0700
@@ -353,10 +353,10 @@
     gchar *tmp = g_strdup(in);
 
     /* split out the host/port and key */
-    tmp += 6;
     workbuf = tmp;
+    workbuf += 6;
 
-    keybuf = strchr(tmp, '/');
+    keybuf = strchr(workbuf, '/');
     *keybuf++ = '\0';
 
     *key = g_strdup(keybuf);
@@ -385,10 +385,10 @@
     gchar *tmp = g_strdup(in);
 
     /* split out the host/port and key */
-    tmp += 7;
     workbuf = tmp;
+    workbuf += 7;
 
-    keybuf = strchr(tmp, '/');
+    keybuf = strchr(workbuf, '/');
     *keybuf++ = '\0';
 
     *key = g_strdup(keybuf);