summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2015-03-03 00:04:04 -0800
committerPatrick Ohly <patrick.ohly@intel.com>2015-03-03 00:04:04 -0800
commitf13106e145b806c4b792ace4457e217ff1b5ea4c (patch)
tree6e55aa3d3cf5e6e06fa05948c6dde6cef5c8cef4
parent181c0c59e4a42fad94b599d2e7ec18fad0c013d5 (diff)
vStringObjPrintf: fix potential va_start leak
va_start() may allocate resources and thus has to be matched by va_end(). Found with cppcheck 1.67.
-rwxr-xr-xsrc/sysync/stringutils.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sysync/stringutils.cpp b/src/sysync/stringutils.cpp
index f62a35c..437eb3f 100755
--- a/src/sysync/stringutils.cpp
+++ b/src/sysync/stringutils.cpp
@@ -823,9 +823,10 @@ void vStringObjPrintf(string &aStringObj, const char *aFormat, bool aAppend, va_
#endif
{
// small default buffer was big enough, add it
- if (actualsize<0) return; // abort, error
+ if (actualsize<0) goto done; // abort, error
aStringObj += buf;
}
+ done:
#ifndef NO_VSNPRINTF
va_end(args);
#endif