This is the mail archive of the
gsl-discuss@sourceware.org
mailing list for the GSL project.
Re: Patch to fix complaints from valgrind about make check for randist
- From: "Jonathan G. Underwood" <j dot underwood at open dot ac dot uk>
- To: gsl-discuss at sources dot redhat dot com
- Date: Tue, 30 Aug 2005 16:47:32 +0100
- Subject: Re: Patch to fix complaints from valgrind about make check for randist
- References: <43143648.1090305@open.ac.uk>
Actually, it seems that patch didn't catch them all. This one, which
should be used instead, *should* catch them all.
Index: test.c
===================================================================
RCS file: /cvs/gsl/gsl/randist/test.c,v
retrieving revision 1.43
diff -u -r1.43 test.c
--- test.c 22 Aug 2005 15:23:18 -0000 1.43
+++ test.c 30 Aug 2005 15:43:15 -0000
@@ -213,6 +213,10 @@
gsl_rng *r_global;
+static gsl_ran_discrete_t *g1 = NULL;
+static gsl_ran_discrete_t *g2 = NULL;
+static gsl_ran_discrete_t *g3 = NULL;
+
int
main (void)
{
@@ -337,6 +341,11 @@
testDiscretePDF (FUNC2 (negative_binomial));
testDiscretePDF (FUNC2 (pascal));
+ gsl_rng_free (r_global);
+ gsl_ran_discrete_free (g1);
+ gsl_ran_discrete_free (g2);
+ gsl_ran_discrete_free (g3);
+
exit (gsl_test_summary ());
}
@@ -922,10 +931,6 @@
}
-static gsl_ran_discrete_t *g1 = NULL;
-static gsl_ran_discrete_t *g2 = NULL;
-static gsl_ran_discrete_t *g3 = NULL;
-
double
test_discrete1 (void)
{