tests: fix a memory leak
authorBartosz Golaszewski <bartekgola@gmail.com>
Sun, 11 Jun 2017 18:15:50 +0000 (20:15 +0200)
committerBartosz Golaszewski <bartekgola@gmail.com>
Sun, 11 Jun 2017 18:15:50 +0000 (20:15 +0200)
We don't free the string allocated by asprintf() in a test case for
gpioinfo. Fix it.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
tests/tests-gpioinfo.c

index fc7c9408a6af75a992971de0fe9a8499c342d2dc..e2b7419361aad13a658b826772d8c5b2fa790b6d 100644 (file)
@@ -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,