X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fexamine.q;h=7d5c2b2b9d89d4c186bf0471290147d6efd94e70;hb=a19e7749cdb8713316fde220f2fc9a5ad5dc79ed;hp=469b413c743c4ebde5c51d6e6a84ebc11296fac1;hpb=2c4c4a789e9c23478bce195d2ed98bab6064dfc1;p=pspp diff --git a/src/examine.q b/src/examine.q index 469b413c74..7d5c2b2b9d 100644 --- a/src/examine.q +++ b/src/examine.q @@ -132,7 +132,7 @@ void box_plot_group(const struct factor *fctr, void box_plot_variables(const struct factor *fctr, - struct variable **vars, int n_vars, + const struct variable **vars, int n_vars, const struct variable *id ); @@ -211,7 +211,10 @@ cmd_examine(void) multipass_procedure_with_splits (run_examine, &cmd); if ( totals ) - free(totals); + free( totals ); + + if ( dependent_vars ) + free (dependent_vars); subc_list_double_destroy(&percentile_list); @@ -485,6 +488,7 @@ xmn_custom_variables(struct cmd_examine *cmd ) assert(n_dependent_vars); totals = xmalloc( sizeof(struct metrics) * n_dependent_vars); + memset ( totals, 0, sizeof(struct metrics) * n_dependent_vars); if ( lex_match(T_BY)) { @@ -786,8 +790,13 @@ run_examine(const struct casefile *cf, void *cmd_ ) output_examine(); - for ( v = 0 ; v < n_dependent_vars ; ++v ) - hsh_destroy(totals[v].ordered_data); + + if ( totals ) + { + int i; + for ( i = 0 ; i < n_dependent_vars ; ++i ) + metrics_destroy(&totals[i]); + } } @@ -1623,7 +1632,7 @@ populate_descriptives(struct tab_table *tbl, int col, int row, void box_plot_variables(const struct factor *fctr, - struct variable **vars, int n_vars, + const struct variable **vars, int n_vars, const struct variable *id) { @@ -1687,7 +1696,7 @@ void box_plot_group(const struct factor *fctr, const struct variable **vars, int n_vars, - const struct variable *id) + const struct variable *id UNUSED) { int i;