From 23dba65f031954df896bc3c6dfb1a9705574886b Mon Sep 17 00:00:00 2001 From: Herman Semenoff Date: Wed, 8 Apr 2026 12:58:55 +0300 Subject: apt: modernize to make_unique C++17 References: - https://stackoverflow.com/questions/79700634/pros-and-cons-of-make-unique-vs-direct-constructor-call-in-c17 - https://towardsdev.com/why-std-make-unique-beats-new-in-modern-c-7e2ba653737e - https://www.sololearn.com/en/Discuss/3334779/where-make_unique-is-better-than-unique_ptrraw-pointer --- apt-pkg/contrib/fileutl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg/contrib/fileutl.cc') diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 74f5ec8bc..832e87127 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -3346,7 +3346,7 @@ bool DropPrivileges() /*{{{*/ { // Verify that the user isn't still in any supplementary groups long const ngroups_max = sysconf(_SC_NGROUPS_MAX); - std::unique_ptr gidlist(new gid_t[ngroups_max]); + auto gidlist = std::make_unique(ngroups_max); if (unlikely(gidlist == NULL)) return _error->Error("Allocation of a list of size %lu for getgroups failed", ngroups_max); ssize_t gidlist_nr; -- cgit v1.2.3-70-g09d2