summaryrefslogtreecommitdiff
path: root/src/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.c')
-rw-r--r--src/parser.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/parser.c b/src/parser.c
index b4f90fc..633bc2f 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -276,8 +276,9 @@ p_parse(ParserState* state)
ans = (MPNumber *) (*(state->root->evaluate))(state->root);
if(ans)
{
+ state->ret = mp_new();
mp_set_from_mp(ans, &state->ret);
- free(ans);
+ mp_free(ans);
return PARSER_ERR_NONE;
}
return PARSER_ERR_INVALID;
@@ -330,10 +331,11 @@ p_check_variable(ParserState* state, gchar* name)
{
return FALSE;
}
-
+ temp = mp_new();
/* If defined, then get the variable */
if((*(state->get_variable))(state, name, &temp))
{
+ mp_clear(&temp);
return TRUE;
}
@@ -354,6 +356,7 @@ p_check_variable(ParserState* state, gchar* name)
}
free(buffer);
}
+ mp_clear(&temp);
if(!result)
{
return FALSE;