[gnac/devel] Fixed memory leaks



commit 7354bc6180924ea692f99715d5106caa0e0b0227
Author: BenoÃt Dupasquier <bdupasqu src gnome org>
Date:   Sun Apr 22 12:59:35 2012 +0100

    Fixed memory leaks

 src/gnac-playlist.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/gnac-playlist.c b/src/gnac-playlist.c
index 5ad72c1..de068a9 100755
--- a/src/gnac-playlist.c
+++ b/src/gnac-playlist.c
@@ -235,12 +235,18 @@ gnac_playlist_parse_xspf(GFile *file)
     if (!*lines[i]) continue;
 
     gchar *line = g_strstrip(lines[i]);
+    gchar *lc_line = g_utf8_strdown(lines[i], -1);
 
-    if (g_str_has_prefix(line, "<location>")) {
-      line = g_strsplit(line, ">", 2)[1];
-      line = g_strsplit(line, "<", 2)[0];
+    if (g_str_has_prefix(lc_line, "<location>")) {
+      gchar **tmp1 = g_strsplit(line, ">", 2);
+      gchar **tmp2 = g_strsplit(tmp1[1], "<", 2);
+      g_strfreev(tmp1);
+      line = tmp2[0];
       gnac_playlist_resolve_uri_and_add(parent, line);
+      g_strfreev(tmp2);
     }
+
+    g_free(lc_line);
   }
 
   g_strfreev(lines);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]