mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-03 12:06:43 +00:00
coverity: #1425867
do not pass NULL pointer to chdir() Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
3ca108148b
commit
d6d979bc2b
@ -1186,9 +1186,11 @@ int lxc_attach(const char *name, const char *lxcpath,
|
||||
new_cwd = options->initial_cwd;
|
||||
else
|
||||
new_cwd = cwd;
|
||||
ret = chdir(new_cwd);
|
||||
if (ret < 0)
|
||||
WARN("Could not change directory to \"%s\".", new_cwd);
|
||||
if (new_cwd) {
|
||||
ret = chdir(new_cwd);
|
||||
if (ret < 0)
|
||||
WARN("Could not change directory to \"%s\"", new_cwd);
|
||||
}
|
||||
free(cwd);
|
||||
|
||||
/* Now create the real child process. */
|
||||
|
Loading…
Reference in New Issue
Block a user