tests: fix minor memory leak

This commit is contained in:
Lennart Poettering 2014-11-19 16:43:41 +01:00
parent 575ccc1b69
commit e1ba963fdf
2 changed files with 2 additions and 1 deletions

View 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, "*"))) \

View file

@ -1217,6 +1217,7 @@ static void test_unquote_first_word(void) {
p = original = "\'fooo";
assert_se(unquote_first_word(&p, &t, true) > 0);
assert_se(streq(t, "fooo"));
free(t);
assert_se(p == original + 5);
p = original = "yay\'foo\'bar";