mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-22 13:33:56 +03:00
test: fix potential use-after-free
CID#1428676.
This commit is contained in:
parent
80cf50120c
commit
111e71c431
@ -388,7 +388,7 @@ static void test_cg_get_keyed_attribute(void) {
|
||||
assert_se(val == NULL);
|
||||
|
||||
assert_se(cg_get_keyed_attribute("cpu", "/init.scope", "cpu.stat", STRV_MAKE("usage_usec"), &val) == 0);
|
||||
free(val);
|
||||
val = mfree(val);
|
||||
|
||||
assert_se(cg_get_keyed_attribute_graceful("cpu", "/init.scope", "cpu.stat", STRV_MAKE("usage_usec"), &val) == 1);
|
||||
log_info("cpu /init.scope cpu.stat [usage_usec] → \"%s\"", val);
|
||||
|
Loading…
Reference in New Issue
Block a user