Fix numerous memory leaks.
[pspp] / src / output / charts / boxplot.c
index 0a933195d04e59adbab217c5e52ed6743d41d0e0..0abb971f44a28909cf7939c3b78b2dc57ede2937 100644 (file)
@@ -41,7 +41,11 @@ boxplot_add_box (struct boxplot *boxplot,
                  struct box_whisker *bw, const char *label)
 {
   if (boxplot == NULL)
-    return;
+    {
+      struct statistic *statistic = &bw->parent.parent;
+      statistic->destroy (statistic);
+      return;
+    }
 
   struct boxplot_box *box;
   if (boxplot->n_boxes >= boxplot->boxes_allocated)