Commit 8607fbc7 authored by Ivanov Mikhail's avatar Ivanov Mikhail Committed by Greg Kroah-Hartman
Browse files

samples/landlock: Fix incorrect free in populate_ruleset_net



[ Upstream commit 42212936 ]

Pointer env_port_name changes after strsep(). Memory allocated via
strdup() will not be freed if landlock_add_rule() returns non-zero value.

Fixes: 5e990dce ("samples/landlock: Support TCP restrictions")
Signed-off-by: default avatarIvanov Mikhail <ivanov.mikhail1@huawei-partners.com>
Reviewed-by: default avatarKonstantin Meskhidze <konstantin.meskhidze@huawei.com>
Link: https://lore.kernel.org/r/20240326095625.3576164-1-ivanov.mikhail1@huawei-partners.com


Signed-off-by: default avatarMickaël Salaün <mic@digikod.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 6564fc18
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment