Plugged some small memory leaks
[pspp-builds.git] / src / data / format.c
index 06042d0e7009d67f9cc1f61d307521b524eb9905..e236aa310019030b29c4e0aafaedaef300eff894 100644 (file)
@@ -60,10 +60,15 @@ fmt_init (void)
     }
 }
 
+static struct fmt_number_style *styles[FMT_NUMBER_OF_FORMATS];
+
 /* Deinitialize the format module. */
 void
 fmt_done (void)
 {
+  int t;
+  for (t = 0 ; t < FMT_NUMBER_OF_FORMATS ; ++t )
+         fmt_number_style_destroy (styles[t]);
 }
 
 /* Returns an input format specification with type TYPE, width W,
@@ -745,7 +750,6 @@ max_digits_for_bytes (int bytes)
   return map[bytes - 1];
 }
 \f
-static struct fmt_number_style *styles[FMT_NUMBER_OF_FORMATS];
 
 /* Creates and returns a new struct fmt_number_style,
    initializing all affixes to empty strings. */