From: Frank Mori Hess Date: Wed, 2 May 2001 15:16:03 +0000 (+0000) Subject: added checks for malloc failure X-Git-Tag: r0_7_16~97 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=193b1b571c4dbb33e165fc37920edc08b97c8b4d;p=comedilib.git added checks for malloc failure --- 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;