From 193b1b571c4dbb33e165fc37920edc08b97c8b4d Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Wed, 2 May 2001 15:16:03 +0000 Subject: [PATCH] added checks for malloc failure --- comedi_calibrate/comedi_calibrate.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/comedi_calibrate/comedi_calibrate.c b/comedi_calibrate/comedi_calibrate.c index beb3910..b388d25 100644 --- a/comedi_calibrate/comedi_calibrate.c +++ b/comedi_calibrate/comedi_calibrate.c @@ -782,6 +782,11 @@ double check_gain_chan_x(linear_fit_t *l,int ad_chan,int range,int cdac) l->n=0; l->y_data=malloc(n*sizeof(double)/step); + if(l->y_data == NULL) + { + perror("comedi_calibrate"); + exit(1); + } orig=caldacs[cdac].current; @@ -923,6 +928,11 @@ int new_sv_measure(new_sv_t *sv) n=1<order; data=malloc(sizeof(sampl_t)*n); + if(data == NULL) + { + perror("comedi_calibrate"); + exit(1); + } for(i=0;it.data=data+i; @@ -961,6 +971,11 @@ int new_sv_measure_order(new_sv_t *sv,int order) n=1<t.data=data+i; -- 2.26.2