summaryrefslogtreecommitdiff
path: root/apt-pkg/edsp/edspindexfile.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/edsp/edspindexfile.cc')
-rw-r--r--apt-pkg/edsp/edspindexfile.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/apt-pkg/edsp/edspindexfile.cc b/apt-pkg/edsp/edspindexfile.cc
index 042a88cf9..1a8af89f0 100644
--- a/apt-pkg/edsp/edspindexfile.cc
+++ b/apt-pkg/edsp/edspindexfile.cc
@@ -16,9 +16,10 @@
#include <apt-pkg/pkgcache.h>
#include <apt-pkg/pkgrecords.h>
+#include <memory>
+#include <string>
#include <stddef.h>
#include <unistd.h>
-#include <string>
/*}}}*/
// EDSP-like Index /*{{{*/
@@ -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();
}
/*}}}*/