X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmath%2Ftrimmed-mean.c;h=4840fd2d66e0375a6114e3585fc5795b9acf60d7;hb=c2b19a85c1d156d72f1b853bffdcca2c2690e79c;hp=b643651a26aa4240e0340768b32af1c3ed37a320;hpb=92beabc20b287841f195cfa3576d031c655df490;p=pspp diff --git a/src/math/trimmed-mean.c b/src/math/trimmed-mean.c index b643651a26..4840fd2d66 100644 --- a/src/math/trimmed-mean.c +++ b/src/math/trimmed-mean.c @@ -44,8 +44,6 @@ static void destroy (struct statistic *s) { struct trimmed_mean *tm = UP_CAST (s, struct trimmed_mean, parent.parent); - struct order_stats *os = &tm->parent; - free (os->k); free (tm); } @@ -57,7 +55,7 @@ trimmed_mean_create (double W, double tail) struct statistic *stat = &os->parent; os->n_k = 2; - os->k = xcalloc (2, sizeof (*os->k)); + os->k = tm->k; assert (tail >= 0); assert (tail <= 1);