diff options
Diffstat (limited to 'apt-pkg/edsp/edspindexfile.cc')
-rw-r--r-- | apt-pkg/edsp/edspindexfile.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/apt-pkg/edsp/edspindexfile.cc b/apt-pkg/edsp/edspindexfile.cc index 042a88cf9..2d030daaf 100644 --- a/apt-pkg/edsp/edspindexfile.cc +++ b/apt-pkg/edsp/edspindexfile.cc @@ -18,6 +18,7 @@ #include <stddef.h> #include <unistd.h> +#include <memory> #include <string> /*}}}*/ @@ -61,12 +62,12 @@ std::string edspIndex::GetComponent() const pkgCacheListParser * edspIndex::CreateListParser(FileFd &Pkg) { if (Pkg.IsOpen() == false) - return NULL; + return nullptr; _error->PushToStack(); - pkgCacheListParser * const Parser = new edspListParser(&Pkg); + std::unique_ptr<pkgCacheListParser> Parser(new edspListParser(&Pkg)); bool const newError = _error->PendingError(); _error->MergeWithStack(); - return newError ? NULL : Parser; + return newError ? nullptr : Parser.release(); } /*}}}*/ // EIPP Index /*{{{*/ @@ -80,12 +81,12 @@ std::string eippIndex::GetComponent() const pkgCacheListParser * eippIndex::CreateListParser(FileFd &Pkg) { if (Pkg.IsOpen() == false) - return NULL; + return nullptr; _error->PushToStack(); - pkgCacheListParser * const Parser = new eippListParser(&Pkg); + std::unique_ptr<pkgCacheListParser> Parser(new eippListParser(&Pkg)); bool const newError = _error->PendingError(); _error->MergeWithStack(); - return newError ? NULL : Parser; + return newError ? nullptr : Parser.release(); } /*}}}*/ |