diff options
author | hanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4> | 2000-06-19 16:20:54 +0000 |
---|---|---|
committer | hanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4> | 2000-06-19 16:20:54 +0000 |
commit | d61888aa76c9f21a6bfb4ce4a27dbbdd438926e1 (patch) | |
tree | 91712c766af3647ca3fd30c013c3eacb795efaa9 | |
parent | ade63f027c22e0a8cb6a15e65d45f52d5fe4e131 (diff) | |
download | mpfr-d61888aa76c9f21a6bfb4ce4a27dbbdd438926e1.tar.gz |
This patch suppresses a few mem leaks.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@637 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | tests/tmul_2exp.c | 2 | ||||
-rw-r--r-- | tests/tset_str.c | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/tests/tmul_2exp.c b/tests/tmul_2exp.c index 96da66435..c945b3808 100644 --- a/tests/tmul_2exp.c +++ b/tests/tmul_2exp.c @@ -51,10 +51,12 @@ main(argc,argv) int argc; char *argv[]; if (x != (z = mpfr_get_d(w)*1024)) { fprintf(stderr, "%f != %f\n", x, z); + mpfr_clear(w); return (-1); } } + mpfr_clear(w); return (0); } diff --git a/tests/tset_str.c b/tests/tset_str.c index 0381a3727..947d9fdc3 100644 --- a/tests/tset_str.c +++ b/tests/tset_str.c @@ -81,15 +81,20 @@ main(int argc, char **argv) fprintf(stderr, "Error in mpfr_set_str\n"); mpfr_print_raw(x); putchar('\n'); mpfr_print_raw(y); putchar('\n'); + mpfr_clear(x); mpfr_clear(y); exit(1); } + free(str); + mpfr_set_prec(x, 53); mpfr_set_str_raw(x, "+110101100.01010000101101000000100111001000101011101110E00"); mpfr_set_str_raw(x, "1.0"); if (mpfr_get_d(x) != 1.0) { - fprintf(stderr, "Error in mpfr_set_str_raw for s=1.0\n"); exit(1); + fprintf(stderr, "Error in mpfr_set_str_raw for s=1.0\n"); + mpfr_clear(x); mpfr_clear(y); + exit(1); } mpfr_set_str(x, "+243495834958.53452345E1", 10, GMP_RNDN); @@ -122,10 +127,12 @@ main(int argc, char **argv) printf("x="); mpfr_print_raw(x); putchar('\n'); printf("s=%s, exp=%d, base=%d\n", str, (int) e, base); printf("y="); mpfr_print_raw(y); putchar('\n'); + mpfr_clear(x); mpfr_clear(y); exit(1); } + free(str); } - mpfr_clear(x); mpfr_clear(y); free(str); + mpfr_clear(x); mpfr_clear(y); return 0; } |