From 30b917b3be55c9f2ab6ea4d48ee7cda4de0354f4 Mon Sep 17 00:00:00 2001 From: hasufell Date: Sun, 25 May 2014 19:54:03 +0200 Subject: [PATCH] POLY: free the array pointer as well --- src/poly.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/poly.c b/src/poly.c index e057f9e..be9f522 100644 --- a/src/poly.c +++ b/src/poly.c @@ -121,7 +121,9 @@ void poly_delete(fmpz_poly_t poly) /** * Delete the internal structure of a polynomial - * array which must be NULL terminated. + * array which must be NULL terminated. It is expected + * that poly_array is not on the stack and was obtained + * by a function like ascii_to_poly(). * * @param poly_array the polynomial array */ @@ -134,6 +136,7 @@ void poly_delete_array(fmpz_poly_t **poly_array) free(*(poly_array[i])); i++; } + free(poly_array); } /**