]> git.ipfire.org Git - thirdparty/systemd.git/commit
core/unit: fix superficial NULL-pointer dereference 31367/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 17 Feb 2024 07:50:42 +0000 (16:50 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 17 Feb 2024 07:50:46 +0000 (16:50 +0900)
commitad48cc6f81ae17f41384c706b818ddca52e0f1d1
treeba66b81478090deafdd148a3cc7fa3027f47f152
parente7cf5c82da90366a0a7ae22b7e03a2f3692210c9
core/unit: fix superficial NULL-pointer dereference

Though, when unit_prepare_exec() is called, the unit should always
have the cgroup runtime context 'crt'. So, I think we can insert assert().
But, for consistency with other places that call unit_get_cgroup_runtime(),
here use the simple non-NULL check for 'crt' instead of using assert().

Follow-up for 9cc545447e31ed38d71c00d5957c4dee0b5bce97.

Fixes CID#1534667.
src/core/unit.c