From: Zbigniew Jędrzejewski-Szmek Date: Tue, 10 Mar 2020 09:54:43 +0000 (+0100) Subject: test-cgroup: fix memleak X-Git-Tag: v246-rc1~762^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1c132196b1164c1e181280d92f8ac52d0311a085;p=thirdparty%2Fsystemd.git test-cgroup: fix memleak https://github.com/systemd/systemd/pull/14901#issuecomment-587924705. --- 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);