summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-03-19 22:07:23 +0100
committerRobert Antoni Buj Gelonch <[email protected]>2020-04-08 00:46:08 +0200
commit2e5b3891e485237a7860a84b141a770b0a867ea1 (patch)
tree233caa15010e742790016a322d2ce31d383d12e7
parentf01e2c0a0efb773341f5d2f2822765644f4859d7 (diff)
downloadmate-calc-2e5b3891e485237a7860a84b141a770b0a867ea1.tar.bz2
mate-calc-2e5b3891e485237a7860a84b141a770b0a867ea1.tar.xz
test-mp-equation: Fix memory leak
-rw-r--r--src/test-mp-equation.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/test-mp-equation.c b/src/test-mp-equation.c
index 861c445..c1c136a 100644
--- a/src/test-mp-equation.c
+++ b/src/test-mp-equation.c
@@ -77,9 +77,12 @@ static void
Test(char *expression, char *expected, int expected_error, int trailing_digits)
{
MPErrorCode error;
+ char *error_token = NULL;
MPNumber result = mp_new();
- error = mp_equation_parse(expression, &options, &result, NULL);
+ error = mp_equation_parse(expression, &options, &result, &error_token);
+ if (error_token)
+ g_free (error_token);
if (error == 0) {
char *result_str;