From c614d66183639638f588422e2b0b3258d4f52323 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 28 Jul 2016 12:41:27 +0200 Subject: gpgv: Unlink the correct temp file in error case Previously, when data could be created and sig not, we would unlink sig, not data (and vice versa). (cherry picked from commit d0d06f44ed60a3888528d834a799bae86c2978d5) --- apt-pkg/contrib/gpgv.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'apt-pkg/contrib') diff --git a/apt-pkg/contrib/gpgv.cc b/apt-pkg/contrib/gpgv.cc index 0929ae0e2..4a2f34043 100644 --- a/apt-pkg/contrib/gpgv.cc +++ b/apt-pkg/contrib/gpgv.cc @@ -118,9 +118,9 @@ void ExecGPGV(std::string const &File, std::string const &FileGPG, if (sigFd == -1 || dataFd == -1) { if (dataFd != -1) - unlink(sig); - if (sigFd != -1) unlink(data); + if (sigFd != -1) + unlink(sig); ioprintf(std::cerr, "Couldn't create tempfiles for splitting up %s", File.c_str()); exit(EINTERNAL); } @@ -134,9 +134,9 @@ void ExecGPGV(std::string const &File, std::string const &FileGPG, SplitClearSignedFile(File, &message, &dataHeader, &signature) == false) { if (dataFd != -1) - unlink(sig); - if (sigFd != -1) unlink(data); + if (sigFd != -1) + unlink(sig); ioprintf(std::cerr, "Splitting up %s into data and signature failed", File.c_str()); exit(112); } -- cgit v1.2.3