From f01e2c0a0efb773341f5d2f2822765644f4859d7 Mon Sep 17 00:00:00 2001 From: rbuj Date: Thu, 19 Mar 2020 22:42:37 +0100 Subject: parserfunc: fix memory leak --- src/parserfunc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/parserfunc.c b/src/parserfunc.c index 4ef55d2..ff5c6f4 100644 --- a/src/parserfunc.c +++ b/src/parserfunc.c @@ -595,9 +595,15 @@ pf_do_x_pow_y_int(ParseNode* self) } if (self->right->token != NULL) + { pow = super_atoi(self->right->token->string); + } else - pow = mp_to_integer((MPNumber*) (*(self->right->evaluate))(self->right)); + { + MPNumber* aux = (MPNumber*) (*(self->right->evaluate))(self->right); + pow = mp_to_integer(aux); + mp_free(aux); + } if(!val) { -- cgit v1.2.1