summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/fileutl.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-07-27 22:21:58 +0200
committerJulian Andres Klode <jak@debian.org>2016-10-05 12:02:19 +0200
commitdf47efeb5764bba8ac4789727f9ffe970e5cd756 (patch)
treef3582e3a74f911949eb6a9b87adf31275c3f468c /apt-pkg/contrib/fileutl.cc
parent6a6bcc4b3365a4455539271f87be1fa55ea237f1 (diff)
(error) va_list 'args' was opened but not closed by va_end()
Reported-By: cppcheck Gbp-Dch: Ignore (cherry picked from commit 196d590a99e309764e07c9dc23ea98897eebf53a)
Diffstat (limited to 'apt-pkg/contrib/fileutl.cc')
-rw-r--r--apt-pkg/contrib/fileutl.cc18
1 files changed, 8 insertions, 10 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index b041ef131..76eb6c7f0 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -2656,13 +2656,12 @@ bool FileFd::FileFdErrno(const char *Function, const char *Description,...)
va_list args;
size_t msgSize = 400;
int const errsv = errno;
- while (true)
- {
+ bool retry;
+ do {
va_start(args,Description);
- if (_error->InsertErrno(GlobalError::ERROR, Function, Description, args, errsv, msgSize) == false)
- break;
+ retry = _error->InsertErrno(GlobalError::ERROR, Function, Description, args, errsv, msgSize);
va_end(args);
- }
+ } while (retry);
return false;
}
/*}}}*/
@@ -2671,13 +2670,12 @@ bool FileFd::FileFdError(const char *Description,...) {
Flags |= Fail;
va_list args;
size_t msgSize = 400;
- while (true)
- {
+ bool retry;
+ do {
va_start(args,Description);
- if (_error->Insert(GlobalError::ERROR, Description, args, msgSize) == false)
- break;
+ retry = _error->Insert(GlobalError::ERROR, Description, args, msgSize);
va_end(args);
- }
+ } while (retry);
return false;
}
/*}}}*/