diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2024-02-19 11:55:07 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2024-02-20 11:51:00 +0100 |
commit | b4b4c28214545524d90efed5ebb24054cec78e4e (patch) | |
tree | 01d9f31d199e2ad81c59218f0cc7190662b8b9ce /common/efi | |
parent | 7dd66e63d887f15565434218f768df22cfd31182 (diff) | |
download | barebox-b4b4c28214545524d90efed5ebb24054cec78e4e.tar.gz barebox-b4b4c28214545524d90efed5ebb24054cec78e4e.tar.xz |
default environment: make string arguments const
Change default_environment_path_set() to take a const char * and let
default_environment_path_get() return a const char *.
Also, do not keep a copy of the string passed to
default_environment_path_set() rather than the original string to make
it more clear where the path is allocated. This allows us to free the
string passed to default_environment_path_set() after usage by some
callers.
Link: https://lore.barebox.org/20240219105507.1618465-1-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/efi')
-rw-r--r-- | common/efi/payload/init.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/common/efi/payload/init.c b/common/efi/payload/init.c index cfacdffa67..e2f763853f 100644 --- a/common/efi/payload/init.c +++ b/common/efi/payload/init.c @@ -258,6 +258,7 @@ static int efi_init(void) env = xasprintf("/efivars/barebox-env-%pUl", &efi_barebox_vendor_guid); default_environment_path_set(env); + free(env); return 0; } |