timezone: plug a memleak
authorCosimo Cecchi <cosimoc@gnome.org>
Fri, 18 Jan 2013 22:22:52 +0000 (17:22 -0500)
committerCosimo Cecchi <cosimoc@gnome.org>
Fri, 18 Jan 2013 22:22:52 +0000 (17:22 -0500)
glib/gtimezone.c

index d20ac2b..7bb48d2 100644 (file)
@@ -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);