mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-06 08:39:22 +00:00
Merge pull request #2267 from brauner/QbitLogic-master
Mergeable branch for C0deAi fixes
This commit is contained in:
commit
e456a1ef55
@ -100,7 +100,6 @@ static struct arguments my_args = {
|
||||
static void prevent_forking(void)
|
||||
{
|
||||
FILE *f;
|
||||
int fd = -1;
|
||||
size_t len = 0;
|
||||
char *line = NULL;
|
||||
char path[MAXPATHLEN];
|
||||
@ -110,7 +109,7 @@ static void prevent_forking(void)
|
||||
return;
|
||||
|
||||
while (getline(&line, &len, f) != -1) {
|
||||
int ret;
|
||||
int fd, ret;
|
||||
char *p, *p2;
|
||||
|
||||
p = strchr(line, ':');
|
||||
@ -146,11 +145,11 @@ static void prevent_forking(void)
|
||||
goto on_error;
|
||||
}
|
||||
|
||||
if (write(fd, "1", 1) != 1)
|
||||
ret = write(fd, "1", 1);
|
||||
if (ret != 1)
|
||||
SYSERROR("Failed to write to \"%s\"", path);
|
||||
|
||||
close(fd);
|
||||
fd = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -73,8 +73,10 @@ int lxc_rsync_exec(const char *src, const char *dest)
|
||||
return -1;
|
||||
|
||||
ret = snprintf(s, l, "%s", src);
|
||||
if (ret < 0 || (size_t)ret >= l)
|
||||
if (ret < 0 || (size_t)ret >= l) {
|
||||
free(s);
|
||||
return -1;
|
||||
}
|
||||
|
||||
s[l - 2] = '/';
|
||||
s[l - 1] = '\0';
|
||||
|
@ -794,8 +794,11 @@ int lxc_config_define_add(struct lxc_list *defines, char *arg)
|
||||
return -1;
|
||||
|
||||
dent->elem = parse_line(arg);
|
||||
if (!dent->elem)
|
||||
if (!dent->elem) {
|
||||
free(dent);
|
||||
return -1;
|
||||
}
|
||||
|
||||
lxc_list_add_tail(defines, dent);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user