diff options
author | Elliott Hughes <enh@google.com> | 2020-12-09 20:22:29 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-12-09 20:22:29 +0000 |
commit | ebcf0925fc8ebfc677fb6b4c8d31d2f4b58ba5cc (patch) | |
tree | 03cc774714b51f29feef6647ed9ec51e683332b8 | |
parent | e495bce0af9ddf9c254bb521a3dba83065d338fa (diff) | |
parent | 2acdc9de3378d2b74b16265a9a3d8c9c08b397e5 (diff) | |
download | core-ebcf0925fc8ebfc677fb6b4c8d31d2f4b58ba5cc.tar.gz |
Merge "Use freecon() with getcon()/getfilecon()." am: 2acdc9de33
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1521162
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I023300186b76bba84632d278e454987688a9b325
-rw-r--r-- | init/service.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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<std::string> ComputeContextFromExecutable(const std::string& servi if (getcon(&raw_con) == -1) { return Error() << "Could not get security context"; } - std::unique_ptr<char> mycon(raw_con); + std::unique_ptr<char, decltype(&freecon)> mycon(raw_con, freecon); if (getfilecon(service_path.c_str(), &raw_filecon) == -1) { return Error() << "Could not get file context"; } - std::unique_ptr<char> filecon(raw_filecon); + std::unique_ptr<char, decltype(&freecon)> filecon(raw_filecon, freecon); char* new_con = nullptr; int rc = security_compute_create(mycon.get(), filecon.get(), |