Fix segfault drawing pie charts with old versions of libplot.
[pspp-builds.git] / src / language / stats / examine.q
index 4254d4fbb5ec9fbe8ac3ce3900ddc19c1e6911a5..592bb56b13fa18d02279a6c50082f448e51849d5 100644 (file)
@@ -1797,6 +1797,9 @@ box_plot_variables (const struct factor *fctr,
       double y_min = DBL_MAX;
       double y_max = -DBL_MAX;
       struct chart *ch = chart_create ();
+      if (ch == NULL)
+        break;
+
       ds_init_empty (&str);
       factor_to_string (fctr, *fs, 0, &str );
 
@@ -1852,6 +1855,8 @@ box_plot_group (const struct factor *fctr,
       struct chart *ch;
 
       ch = chart_create ();
+      if (ch == NULL)
+        break;
 
       boxplot_draw_yscale (ch, totals[i].max, totals[i].min);