if (!c->lxc_conf)
return false;
- if ((ret = ongoing_create(c)) < 0) {
+ ret = ongoing_create(c);
+ if (ret < 0) {
ERROR("Error checking for incomplete creation");
return false;
- }
- if (ret == 2) {
- ERROR("Error: %s creation was not completed", c->name);
- do_lxcapi_destroy(c);
- return false;
} else if (ret == 1) {
ERROR("Error: creation of %s is ongoing", c->name);
return false;
+ } else if (ret == 2) {
+ ERROR("Error: %s creation was not completed", c->name);
+ do_lxcapi_destroy(c);
+ return false;
}
/* is this app meant to be run through lxcinit, as in lxc-execute? */
*/
if (daemonize) {
char title[2048];
+ pid_t pid;
- pid_t pid = fork();
+ pid = fork();
if (pid < 0) {
+ free_init_cmd(init_cmd);
lxc_free_handler(handler);
return false;
}
if (pid_fp == NULL) {
SYSERROR("Failed to create pidfile '%s' for '%s'",
c->pidfile, c->name);
+ free_init_cmd(init_cmd);
lxc_free_handler(handler);
if (daemonize)
exit(1);
SYSERROR("Failed to write '%s'", c->pidfile);
fclose(pid_fp);
pid_fp = NULL;
+ free_init_cmd(init_cmd);
lxc_free_handler(handler);
if (daemonize)
exit(1);
if (conf->monitor_unshare) {
if (unshare(CLONE_NEWNS)) {
SYSERROR("failed to unshare mount namespace");
+ free_init_cmd(init_cmd);
lxc_free_handler(handler);
return false;
}
if (mount(NULL, "/", NULL, MS_SLAVE|MS_REC, NULL)) {
SYSERROR("Failed to make / rslave at startup");
+ free_init_cmd(init_cmd);
lxc_free_handler(handler);
return false;
}