mirror of
https://github.com/systemd/systemd.git
synced 2025-01-14 23:24:38 +03:00
tests: fix minor memory leak
This commit is contained in:
parent
575ccc1b69
commit
e1ba963fdf
@ -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, "*"))) \
|
||||
|
@ -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";
|
||||
|
Loading…
x
Reference in New Issue
Block a user