if (ctx->personality < 0)
return log_error_errno(-ENOENT, ENOENT, "Failed to get personality of the container");
+ if (!ctx->container->lxc_conf) {
+ ctx->container->lxc_conf = lxc_conf_init();
+ if (!ctx->container->lxc_conf)
+ return log_error_errno(-ENOMEM, ENOMEM, "Failed to allocate new lxc config");
+ }
+
return 0;
}
return -1;
}
- if (!ctx->container->lxc_conf) {
- ctx->container->lxc_conf = lxc_conf_init();
- if (!ctx->container->lxc_conf) {
- put_attach_context(ctx);
- return -1;
- }
- }
conf = ctx->container->lxc_conf;
- if (!conf) {
- put_attach_context(ctx);
- return log_error_errno(-EINVAL, EINVAL, "Missing container confifg");
- }
if (!fetch_seccomp(ctx->container, options))
WARN("Failed to get seccomp policy");