From 1c132196b1164c1e181280d92f8ac52d0311a085 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 10 Mar 2020 10:54:43 +0100 Subject: [PATCH] test-cgroup: fix memleak https://github.com/systemd/systemd/pull/14901#issuecomment-587924705. --- src/test/test-cgroup.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/test-cgroup.c b/src/test/test-cgroup.c index bc4f5260ca6..0971f8461e6 100644 --- a/src/test/test-cgroup.c +++ b/src/test/test-cgroup.c @@ -21,6 +21,9 @@ static void test_cg_split_spec(void) { p = mfree(p); assert_se(cg_split_spec("foobar:", &c, &p) == 0); + c = mfree(c); + p = mfree(p); + assert_se(cg_split_spec("foobar:asdfd", &c, &p) < 0); assert_se(cg_split_spec(":///", &c, &p) < 0); assert_se(cg_split_spec(":", &c, &p) < 0); -- 2.47.3