X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmath%2Ftukey-hinges.c;h=b59b878ba64991c2bea385553e24c8e058ab8c2e;hb=f4bf263b680ffe5dd0befe040b84c179919bbb7d;hp=c483a508c56eff590d4b35e6ac58bf8fb8d4b558;hpb=96994a54e60e9c95b8bba54c2281acf7059b1203;p=pspp diff --git a/src/math/tukey-hinges.c b/src/math/tukey-hinges.c index c483a508c5..b59b878ba6 100644 --- a/src/math/tukey-hinges.c +++ b/src/math/tukey-hinges.c @@ -64,24 +64,21 @@ static void destroy (struct statistic *s) { struct tukey_hinges *th = UP_CAST (s, struct tukey_hinges, parent.parent); - struct order_stats *os = &th->parent; - - free (os->k); - free (s); + free (th); }; struct tukey_hinges * tukey_hinges_create (double W, double c_min) { double d; - struct tukey_hinges *th = xzalloc (sizeof (*th)); + struct tukey_hinges *th = XZALLOC (struct tukey_hinges); struct order_stats *os = &th->parent; struct statistic *stat = &os->parent; assert (c_min >= 0); os->n_k = 3; - os->k = xcalloc (3, sizeof (*os->k)); + os->k = th->k; if (c_min >= 1.0) {