From: John Darrington Date: Tue, 30 Oct 2012 05:54:09 +0000 (+0100) Subject: logistic.c: Fix read from uninitialised memory. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fbuilds%2F20121030030503%2Fpspp;p=pspp logistic.c: Fix read from uninitialised memory. Found-by valgrind. --- diff --git a/src/language/stats/logistic.c b/src/language/stats/logistic.c index fb9a26521a..93472e0294 100644 --- a/src/language/stats/logistic.c +++ b/src/language/stats/logistic.c @@ -390,10 +390,10 @@ beta_hat_initial (const struct lr_spec *cmd, struct lr_result *res, struct caser } } - if (value_equal (&res->y0, depval, width)) + if (v0set && value_equal (&res->y0, depval, width)) sumA += weight; - if (value_equal (&res->y1, depval, width)) + if (v1set && value_equal (&res->y1, depval, width)) sumB += weight;