[glib] timezone: plug a memleak



commit 13966e0fadc40a6fabb0de216e8b2c3b6d457a79
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Fri Jan 18 17:22:52 2013 -0500

    timezone: plug a memleak

 glib/gtimezone.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/glib/gtimezone.c b/glib/gtimezone.c
index d20ac2b..7bb48d2 100644
--- a/glib/gtimezone.c
+++ b/glib/gtimezone.c
@@ -233,7 +233,15 @@ again:
         }
 
       if (tz->t_info != NULL)
-        g_array_free (tz->t_info, TRUE);
+        {
+          gint idx;
+          for (idx = 0; idx < tz->t_info->len; idx++)
+            {
+              TransitionInfo *info = &g_array_index (tz->t_info, TransitionInfo, idx);
+              g_free (info->abbrev);
+            }
+          g_array_free (tz->t_info, TRUE);
+        }
       if (tz->transitions != NULL)
         g_array_free (tz->transitions, TRUE);
       g_free (tz->name);



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