diff options
author | Julian Andres Klode <jak@debian.org> | 2016-07-28 12:41:27 +0200 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2016-08-03 16:40:14 +0200 |
commit | d0d06f44ed60a3888528d834a799bae86c2978d5 (patch) | |
tree | c5696f13fdb85e21bd684b852942013626481d71 /apt-pkg | |
parent | 215598df84c092f801fe154e510c68fcc263b3ba (diff) |
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).
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/contrib/gpgv.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apt-pkg/contrib/gpgv.cc b/apt-pkg/contrib/gpgv.cc index 1873f41f2..15e309448 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); } |