summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-03-19 22:42:37 +0100
committerRobert Antoni Buj Gelonch <[email protected]>2020-04-08 00:45:47 +0200
commitf01e2c0a0efb773341f5d2f2822765644f4859d7 (patch)
tree22d03f22163c1ea11702c77a73fccf029a76d8f5
parent7f43d244e969162ca92d6575085b4196f0c2e19f (diff)
downloadmate-calc-f01e2c0a0efb773341f5d2f2822765644f4859d7.tar.bz2
mate-calc-f01e2c0a0efb773341f5d2f2822765644f4859d7.tar.xz
parserfunc: fix memory leak
-rw-r--r--src/parserfunc.c8
1 files changed, 7 insertions, 1 deletions
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)
{