bugfix: calloc may fail

This commit is contained in:
Cedric Roux
2016-05-10 11:19:56 +02:00
parent 724b6622dd
commit 24af122475
+2
View File
@@ -259,7 +259,9 @@ void xy_plot_set_points(gui *_gui, widget *_this, int plot,
free(this->plots[plot].x);
free(this->plots[plot].y);
this->plots[plot].x = calloc(npoints, sizeof(float));
if (this->plots[plot].x == NULL) abort();
this->plots[plot].y = calloc(npoints, sizeof(float));
if (this->plots[plot].y == NULL) abort();
this->plots[plot].npoints = npoints;
}