summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/test/test-unit-name.c2
-rw-r--r--src/test/test-util.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/test/test-unit-name.c b/src/test/test-unit-name.c
index 256e820c22..ab6c488cff 100644
--- a/src/test/test-unit-name.c
+++ b/src/test/test-unit-name.c
@@ -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, "*"))) \
diff --git a/src/test/test-util.c b/src/test/test-util.c
index 01b0192c1c..01e10c9fc1 100644
--- a/src/test/test-util.c
+++ b/src/test/test-util.c
@@ -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";