From 24b88ce3a271f438c2fd9ea477afa3e212280c0d Mon Sep 17 00:00:00 2001 From: "Kelvin M. Klann" Date: Tue, 14 Nov 2023 15:12:08 -0300 Subject: landlock: simplify variables in ll_add_profile This amends commit 520508d5b ("landlock: avoid parsing landlock commands twice", 2023-11-02) / PR #6078. --- src/firejail/landlock.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/firejail/landlock.c b/src/firejail/landlock.c index 64d10b914..163804053 100644 --- a/src/firejail/landlock.c +++ b/src/firejail/landlock.c @@ -342,16 +342,15 @@ void ll_add_profile(int type, const char *data) { if (!ll_is_supported()) return; - const char *str = data; - while (*str == ' ' || *str == '\t') - str++; + while (*data == ' ' || *data == '\t') + data++; LandlockEntry *ptr = malloc(sizeof(LandlockEntry)); if (!ptr) errExit("malloc"); memset(ptr, 0, sizeof(LandlockEntry)); ptr->type = type; - ptr->data = strdup(str); + ptr->data = strdup(data); if (!ptr->data) errExit("strdup"); ptr->next = cfg.lprofile; -- cgit v1.2.3-70-g09d2