diff libaudacious/titlestring.c @ 1350:ca5d03c4b3f1 trunk

[svn] - extra sanity checking keeps the double-free away
author nenolod
date Wed, 28 Jun 2006 13:16:32 -0700
parents 6636d328fa38
children f12d7e208b43
line wrap: on
line diff
--- a/libaudacious/titlestring.c	Wed Jun 28 13:02:34 2006 -0700
+++ b/libaudacious/titlestring.c	Wed Jun 28 13:16:32 2006 -0700
@@ -53,17 +53,33 @@
 void
 bmp_title_input_free(BmpTitleInput * input)
 {
-    if (!input)
+    if (input == NULL)
         return;
 
-    g_free(input->performer);
-    g_free(input->album_name);
-    g_free(input->track_name);
-    g_free(input->date);
-    g_free(input->genre);
-    g_free(input->comment);
-    g_free(input->file_name);
-    g_free(input->file_path);
+    if (input->performer != NULL)
+        g_free(input->performer);
+
+    if (input->album_name != NULL)
+        g_free(input->album_name);
+
+    if (input->track_name != NULL)
+        g_free(input->track_name);
+
+    if (input->date != NULL)
+        g_free(input->date);
+
+    if (input->genre != NULL)
+        g_free(input->genre);
+
+    if (input->comment != NULL)
+        g_free(input->comment);
+
+    if (input->file_name != NULL)
+        g_free(input->file_name);
+
+    if (input->file_path != NULL)
+        g_free(input->file_path);
+
     g_free(input);
 }