From f6ae9c39d8ffdb6ebfc69405970005a042909e0d Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Thu, 2 Mar 2017 11:28:24 +0100 Subject: [PATCH] tests: fix a memory leak We must free the error string from a failed test after displaying it. Signed-off-by: Bartosz Golaszewski --- tests/unit/gpiod-unit.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/gpiod-unit.c b/tests/unit/gpiod-unit.c index 260edb8..6550577 100644 --- a/tests/unit/gpiod-unit.c +++ b/tests/unit/gpiod-unit.c @@ -442,6 +442,7 @@ int main(int argc GU_UNUSED, char **argv GU_UNUSED) pr_raw("\n\t\t'%s': %s\n", test->name, globals.test_ctx.failed_msg); reset_color(); + free(globals.test_ctx.failed_msg); } else { set_color(CGREEN); pr_raw("OK\n"); -- 2.30.2