summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2013-07-26 12:04:55 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2013-07-26 12:04:55 +0200
commit9ca0d58180366275f5e62b6c5aad066b7b09a1de (patch)
treef79323ffdc2c4966bbbe143b9c69aa99458fac4c /apt-pkg
parentd832304e06838275446a0b787899591061f39160 (diff)
proper cleanup varargs in _error (uncovered by Coverity)
Git-Dch: Ignore
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/contrib/error.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/apt-pkg/contrib/error.cc b/apt-pkg/contrib/error.cc
index 122e2c809..d457781c3 100644
--- a/apt-pkg/contrib/error.cc
+++ b/apt-pkg/contrib/error.cc
@@ -67,9 +67,10 @@ bool GlobalError::NAME (const char *Function, const char *Description,...) { \
int const errsv = errno; \
while (true) { \
va_start(args,Description); \
- if (InsertErrno(TYPE, Function, Description, args, errsv, msgSize) == false) \
- break; \
+ bool const retry = InsertErrno(TYPE, Function, Description, args, errsv, msgSize); \
va_end(args); \
+ if (retry == false) \
+ break; \
} \
return false; \
}
@@ -88,9 +89,10 @@ bool GlobalError::InsertErrno(MsgType const &type, const char *Function,
int const errsv = errno;
while (true) {
va_start(args,Description);
- if (InsertErrno(type, Function, Description, args, errsv, msgSize) == false)
- break;
+ bool const retry = InsertErrno(type, Function, Description, args, errsv, msgSize);
va_end(args);
+ if (retry == false)
+ break;
}
return false;
}