mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-15 02:19:39 +00:00
coverity: rundir: Fix memory leaks
Since we're no longer always returning a getenv result or some defined string, the callers should cleanup the variable after use. As a result, change from const char* to char*, add the needed free() everywhere and use strdup() on strings coming from getenv. Signed-off-by: Stéphane Graber <stgraber@ubuntu.com> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
parent
44b9ae4b8a
commit
fd8c277753
@ -39,7 +39,7 @@ extern void lxc_setup_fs(void);
|
|||||||
extern int get_u16(unsigned short *val, const char *arg, int base);
|
extern int get_u16(unsigned short *val, const char *arg, int base);
|
||||||
extern int mkdir_p(const char *dir, mode_t mode);
|
extern int mkdir_p(const char *dir, mode_t mode);
|
||||||
extern void remove_trailing_slashes(char *p);
|
extern void remove_trailing_slashes(char *p);
|
||||||
extern const char *get_rundir(void);
|
extern char *get_rundir(void);
|
||||||
|
|
||||||
extern const char *lxc_global_config_value(const char *option_name);
|
extern const char *lxc_global_config_value(const char *option_name);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user