From: Bartosz Golaszewski Date: Sun, 11 Jun 2017 18:15:50 +0000 (+0200) Subject: tests: fix a memory leak X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4348a31039163417a5017ac4bc0f872df4e5a4fe;p=qemu-gpiodev%2Flibgpiod.git tests: fix a memory leak We don't free the string allocated by asprintf() in a test case for gpioinfo. Fix it. Signed-off-by: Bartosz Golaszewski --- diff --git a/tests/tests-gpioinfo.c b/tests/tests-gpioinfo.c index fc7c940..e2b7419 100644 --- a/tests/tests-gpioinfo.c +++ b/tests/tests-gpioinfo.c @@ -34,8 +34,8 @@ TEST_DEFINE(gpioinfo_simple, static void gpioinfo_one_exported(void) { TEST_CLEANUP(test_close_chip) struct gpiod_chip *chip = NULL; + TEST_CLEANUP(test_free_str) char *ptrn; struct gpiod_line *line; - char *ptrn; int rv; rv = asprintf(&ptrn,