Ivanov Mikhail c29a9b84cd samples/landlock: Fix incorrect free in populate_ruleset_net
[ Upstream commit 42212936d9d811c7cf6efc4804747a6c417aafd4 ]

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

Fixes: 5e990dcef12e ("samples/landlock: Support TCP restrictions")
Signed-off-by: Ivanov Mikhail <ivanov.mikhail1@huawei-partners.com>
Reviewed-by: Konstantin Meskhidze <konstantin.meskhidze@huawei.com>
Link: https://lore.kernel.org/r/20240326095625.3576164-1-ivanov.mikhail1@huawei-partners.com
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-05-30 09:45:01 +02:00
..
2024-03-02 20:50:59 -08:00
2023-10-10 01:00:50 +09:00
2024-01-12 14:29:48 -08:00