Fix segfault drawing pie charts with old versions of libplot.
[pspp-builds.git] / src / output / charts / plot-hist.c
index b567370c2780222dfe8e5c8fb548601e90a32fd3..88ad0899199d939dd5411cfb8fb2656368e395a4 100644 (file)
@@ -117,6 +117,9 @@ histogram_plot(const gsl_histogram *hist,
   struct chart *ch;
 
   ch = chart_create();
+  if (ch == NULL)
+    return;
+
   chart_write_title(ch, _("HISTOGRAM"));
 
   chart_write_ylabel(ch, _("Frequency"));