2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-09-03 15:55:53 +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:
Adrian Reber
2020-10-14 10:15:04 +00:00
committed by Andrei Vagin
parent 097c931ed3
commit 1ecaee67a5

View File

@@ -537,7 +537,10 @@ static int open_ns_fd(struct file_desc *d, int *new_fd)
else else
break; break;
fd = fdstore_get(nsfd_id); 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'; path[sizeof(path) - 1] = '\0';
fd = open(path, nfi->nfe->flags); fd = open(path, nfi->nfe->flags);
check_open:
if (fd < 0) { if (fd < 0) {
pr_perror("Can't open file %s on restore", path); pr_perror("Can't open file %s on restore", path);
return fd; return fd;
} }
out:
*new_fd = fd; *new_fd = fd;
return 0; return 0;
} }