From: Bartosz Golaszewski Date: Thu, 2 Mar 2017 10:28:24 +0000 (+0100) Subject: tests: fix a memory leak X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f6ae9c39d8ffdb6ebfc69405970005a042909e0d;p=qemu-gpiodev%2Flibgpiod.git tests: fix a memory leak We must free the error string from a failed test after displaying it. Signed-off-by: Bartosz Golaszewski --- 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");