mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
namespaces: fix 'Declaring variable "path" without initializer'
criu/namespaces.c:529: var_decl: Declaring variable "path" without initializer. criu/namespaces.c:602: uninit_use_in_call: Using uninitialized value "*path" as argument to "%s" when calling "print_on_level". Signed-off-by: Adrian Reber <areber@redhat.com>
This commit is contained in:
committed by
Andrei Vagin
parent
097c931ed3
commit
1ecaee67a5
@@ -537,7 +537,10 @@ static int open_ns_fd(struct file_desc *d, int *new_fd)
|
||||
else
|
||||
break;
|
||||
fd = fdstore_get(nsfd_id);
|
||||
goto check_open;
|
||||
if (fd < 0) {
|
||||
return -1;
|
||||
}
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -597,12 +600,11 @@ static int open_ns_fd(struct file_desc *d, int *new_fd)
|
||||
path[sizeof(path) - 1] = '\0';
|
||||
|
||||
fd = open(path, nfi->nfe->flags);
|
||||
check_open:
|
||||
if (fd < 0) {
|
||||
pr_perror("Can't open file %s on restore", path);
|
||||
return fd;
|
||||
}
|
||||
|
||||
out:
|
||||
*new_fd = fd;
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user