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 /arch/arm/mach-omap | |
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 'arch/arm/mach-omap')
-rw-r--r-- | arch/arm/mach-omap/omap_generic.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm/mach-omap/omap_generic.c b/arch/arm/mach-omap/omap_generic.c index 36f2e80af2..99e14fb540 100644 --- a/arch/arm/mach-omap/omap_generic.c +++ b/arch/arm/mach-omap/omap_generic.c @@ -180,6 +180,7 @@ static int omap_env_init(void) partname); default_environment_path_set(envpath); + free(envpath); out: free(partname); |