Commit 24af1224 authored by Cedric Roux's avatar Cedric Roux

bugfix: calloc may fail

parent 724b6622
...@@ -259,7 +259,9 @@ void xy_plot_set_points(gui *_gui, widget *_this, int plot, ...@@ -259,7 +259,9 @@ void xy_plot_set_points(gui *_gui, widget *_this, int plot,
free(this->plots[plot].x); free(this->plots[plot].x);
free(this->plots[plot].y); free(this->plots[plot].y);
this->plots[plot].x = calloc(npoints, sizeof(float)); this->plots[plot].x = calloc(npoints, sizeof(float));
if (this->plots[plot].x == NULL) abort();
this->plots[plot].y = calloc(npoints, sizeof(float)); this->plots[plot].y = calloc(npoints, sizeof(float));
if (this->plots[plot].y == NULL) abort();
this->plots[plot].npoints = npoints; this->plots[plot].npoints = npoints;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment