chiark / gitweb /
tests: fix minor memory leak
[elogind.git] / src / test / test-unit-name.c
index 256e820c224ee85c5c5f688a5b3142515800885f..ab6c488cffb7627901892435b92ea471470ddcf0 100644 (file)
@@ -135,7 +135,7 @@ static int test_unit_printf(void) {
 #define expect(unit, pattern, expected)                                 \
         {                                                               \
                 char *e;                                                \
-                _cleanup_free_ char *t;                                 \
+                _cleanup_free_ char *t = NULL;                          \
                 assert_se(unit_full_printf(unit, pattern, &t) >= 0);    \
                 printf("result: %s\nexpect: %s\n", t, expected);        \
                 if ((e = endswith(expected, "*")))                      \