LOGISTIC REGRESSION: Fix memory leak in error path
[pspp] / src / language / stats / sign.c
index 45973262d986cdf3eb28a0c2651dc532c864f317..e208ce9d9e2dc6d6d781c297a21360a314405103 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 2009, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010, 2011 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
 #include <gsl/gsl_randist.h>
 
 #include "data/casereader.h"
+#include "data/dataset.h"
 #include "data/dictionary.h"
 #include "data/format.h"
 #include "data/missing-values.h"
-#include "data/procedure.h"
 #include "data/variable.h"
 #include "language/stats/npar.h"
 #include "libpspp/str.h"
@@ -174,7 +174,7 @@ sign_execute (const struct dataset *ds,
   const struct two_sample_test *t2s = UP_CAST (test, const struct two_sample_test, parent);
   struct ccase *c;
 
-  struct sign_test_params *stp = xcalloc (sizeof *stp, t2s->n_pairs);
+  struct sign_test_params *stp = xcalloc (t2s->n_pairs, sizeof *stp);
 
   struct casereader *r = input;