Commit f3e52710 by S.Çağlar Onur Committed by Serge Hallyn

call lxc_container_put when appropriate

parent 2ef89d56
......@@ -85,6 +85,7 @@ int main(int argc, char *argv[])
if (!c->may_control(c)) {
ERROR("Insufficent privileges to control %s:%s", my_args.lxcpath[0], my_args.name);
lxc_container_put(c);
return -1;
}
......
......@@ -163,6 +163,7 @@ int main(int argc, char *argv[])
if (!c1->may_control(c1)) {
fprintf(stderr, "Insufficent privileges to control %s\n", orig);
lxc_container_put(c1);
return -1;
}
......
......@@ -113,17 +113,21 @@ int main(int argc, char *argv[])
if (!c->may_control(c)) {
fprintf(stderr, "Insufficent privileges to control %s\n", my_args.name);
lxc_container_put(c);
return -1;
}
if (!c->is_running(c)) {
fprintf(stderr, "%s is not running\n", my_args.name);
lxc_container_put(c);
exit(EXIT_FAILURE);
}
ret = c->console(c, my_args.ttynum, 0, 1, 2, my_args.escape);
if (ret < 0) {
lxc_container_put(c);
exit(EXIT_FAILURE);
}
lxc_container_put(c);
return EXIT_SUCCESS;
}
......@@ -89,6 +89,7 @@ int main(int argc, char *argv[])
if (!c->may_control(c)) {
fprintf(stderr, "Insufficent privileges to control %s\n", my_args.name);
lxc_container_put(c);
return -1;
}
......
......@@ -74,6 +74,7 @@ int main(int argc, char *argv[])
if (!c->may_control(c)) {
ERROR("Insufficent privileges to control %s:%s", my_args.lxcpath[0], my_args.name);
lxc_container_put(c);
return -1;
}
......
......@@ -109,6 +109,7 @@ int main(int argc, char *argv[])
if (!c->may_control(c)) {
fprintf(stderr, "Insufficent privileges to control %s\n", c->name);
lxc_container_put(c);
return -1;
}
......@@ -160,5 +161,6 @@ int main(int argc, char *argv[])
}
}
lxc_container_put(c);
return 0;
}
......@@ -189,6 +189,7 @@ int main(int argc, char *argv[])
if (!c->may_control(c)) {
fprintf(stderr, "Insufficent privileges to control %s\n", my_args.name);
lxc_container_put(c);
return -1;
}
......
......@@ -73,6 +73,7 @@ int main(int argc, char *argv[])
if (!c->may_control(c)) {
ERROR("Insufficent privileges to control %s:%s", my_args.lxcpath[0], my_args.name);
lxc_container_put(c);
return -1;
}
......
......@@ -98,6 +98,7 @@ int main(int argc, char *argv[])
if (!c->may_control(c)) {
fprintf(stderr, "Insufficent privileges to control %s\n", c->name);
lxc_container_put(c);
return -1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment