X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fcrosstabs.q;h=0dbb83719ac434a925e36cf2040553a2f3df1c33;hb=fab68e4ef0a6f43179bdd5bebe959ef391489a7a;hp=3f140059fede345280ed5402e8bbcc01c5ac330f;hpb=f5c108becd49d78f4898cab11352291f5689d24e;p=pspp-builds.git diff --git a/src/language/stats/crosstabs.q b/src/language/stats/crosstabs.q index 3f140059..0dbb8371 100644 --- a/src/language/stats/crosstabs.q +++ b/src/language/stats/crosstabs.q @@ -1,20 +1,18 @@ -/* PSPP - computes sample statistics. +/* PSPP - a program for statistical analysis. Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + along with this program. If not, see . */ /* FIXME: @@ -193,11 +191,16 @@ int cmd_crosstabs (struct lexer *lexer, struct dataset *ds) { int result = internal_cmd_crosstabs (lexer, ds); + int i; free (variables); pool_destroy (pl_tc); pool_destroy (pl_col); + for (i = 0; i < nxtab; i++) + free (xtab[i]); + free (xtab); + return result; } @@ -824,6 +827,16 @@ postcalc (void) } hsh_destroy (gen_tab); + if (mode == INTEGER) + { + int i; + for (i = 0; i < n_sorted_tab; i++) + { + free (sorted_tab[i]->u.data); + free (sorted_tab[i]); + } + free (sorted_tab); + } } static void insert_summary (struct tab_table *, int tab_index, double valid);