From: Jason Stover Date: Fri, 7 Apr 2006 20:02:27 +0000 (+0000) Subject: fixed null pointer checking X-Git-Tag: v0.6.0~1006 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99671fac758efbaaeb4516570fbed93a0a43a480;p=pspp-builds.git fixed null pointer checking --- diff --git a/src/math/linreg/coefficient.c b/src/math/linreg/coefficient.c index cca02bcb..c372cd0e 100644 --- a/src/math/linreg/coefficient.c +++ b/src/math/linreg/coefficient.c @@ -188,11 +188,14 @@ pspp_linreg_get_coeff (const pspp_linreg_cache *c, struct pspp_linreg_coeff *result; const struct variable *tmp; - if (c == NULL || c->coeff == NULL || c->n_indeps == NULL || v == NULL) + if (c == NULL) + { + return NULL; + } + if ( c->coeff == NULL || c->n_indeps == NULL || v == NULL) { return NULL; } - result = c->coeff + i; tmp = pspp_linreg_coeff_get_var (result, 0); while (tmp->index != v->index && i < c->n_coeffs)