From ed27bb089200660270ec530508a924941bc23d0e Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sat, 25 May 2013 20:37:14 +0200 Subject: [PATCH] Fix leak check in oneway command --- src/language/stats/oneway.c | 8 +++++--- src/ui/gui/pspp-sheet-view.c | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/language/stats/oneway.c b/src/language/stats/oneway.c index 9d31b4201f..a30026e8b4 100644 --- a/src/language/stats/oneway.c +++ b/src/language/stats/oneway.c @@ -52,6 +52,7 @@ /* Workspace variable for each dependent variable */ struct per_var_ws { + struct interaction *iact; struct categoricals *cat; struct covariance *cov; struct levene *nl; @@ -702,15 +703,14 @@ run_oneway (const struct oneway_spec *cmd, for (v = 0; v < cmd->n_vars; ++v) { - struct interaction *inter = interaction_create (cmd->indep_var); - struct payload payload; payload.create = makeit; payload.update = updateit; payload.calculate = NULL; payload.destroy = killit; - ws.vws[v].cat = categoricals_create (&inter, 1, cmd->wv, + ws.vws[v].iact = interaction_create (cmd->indep_var); + ws.vws[v].cat = categoricals_create (&ws.vws[v].iact, 1, cmd->wv, cmd->exclude, cmd->exclude); categoricals_set_payload (ws.vws[v].cat, &payload, @@ -874,7 +874,9 @@ run_oneway (const struct oneway_spec *cmd, covariance_destroy (ws.vws[v].cov); levene_destroy (ws.vws[v].nl); dd_destroy (ws.dd_total[v]); + interaction_destroy (ws.vws[v].iact); } + free (ws.vws); free (ws.dd_total); } diff --git a/src/ui/gui/pspp-sheet-view.c b/src/ui/gui/pspp-sheet-view.c index 03b191da5b..468dbae8e2 100644 --- a/src/ui/gui/pspp-sheet-view.c +++ b/src/ui/gui/pspp-sheet-view.c @@ -6606,7 +6606,9 @@ pspp_sheet_view_focus_column (PsppSheetView *tree_view, if (!focus_column->button) { pspp_sheet_view_column_set_need_button (focus_column, TRUE); - g_return_if_fail (focus_column->button != NULL); + // g_return_if_fail (focus_column->button != NULL); + if (focus_column->button == NULL) + return; } if (GTK_CONTAINER (tree_view)->focus_child != focus_column->button) -- 2.30.2