[grilo-plugins] apple-traiers: always free splitted string



commit f70e1d80f4f85b8be59638f2f1988a6433310c70
Author: Víctor Manuel Jáquez Leal <vjaquez igalia com>
Date:   Fri Sep 3 13:50:23 2010 +0200

    apple-traiers: always free splitted string
    
    The previous commit added a potential memory leak. This commit fix
    that issue.

 src/apple-trailers/grl-apple-trailers.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/apple-trailers/grl-apple-trailers.c b/src/apple-trailers/grl-apple-trailers.c
index 6aea9a9..087b6e1 100644
--- a/src/apple-trailers/grl-apple-trailers.c
+++ b/src/apple-trailers/grl-apple-trailers.c
@@ -203,10 +203,9 @@ runtime_to_seconds (const gchar *runtime)
 
   seconds = 0;
   items = g_strsplit (runtime, ":", -1);
-  if (items && items[0] && items[1]) {
+  if (items && items[0] && items[1])
     seconds = 3600 * atoi (items[0]) + 60 * atoi (items[1]);
-    g_strfreev (items);
-  }
+  g_strfreev (items);
 
   return seconds;
 }



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