diff --git a/init/service.cpp b/init/service.cpp index 766eb5d93..d84dcd431 100644 --- a/init/service.cpp +++ b/init/service.cpp @@ -72,12 +72,12 @@ static Result ComputeContextFromExecutable(const std::string& servi if (getcon(&raw_con) == -1) { return Error() << "Could not get security context"; } - std::unique_ptr mycon(raw_con); + std::unique_ptr mycon(raw_con, freecon); if (getfilecon(service_path.c_str(), &raw_filecon) == -1) { return Error() << "Could not get file context"; } - std::unique_ptr filecon(raw_filecon); + std::unique_ptr filecon(raw_filecon, freecon); char* new_con = nullptr; int rc = security_compute_create(mycon.get(), filecon.get(),