After call 'va_start',some place not call 'va_end'

when the 'va_start' and 'va_copy' were called,it should call 'va_end' too.

Change-Id: I621939cacbaa163ac59616ad19f00e214c3094fc
Signed-off-by: z102.zhang <z102.zhang@samsung.com>
Reviewed-on: https://skia-review.googlesource.com/147180
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This commit is contained in:
z102.zhang 2018-08-10 09:08:47 +08:00 committed by Skia Commit-Bot
parent 937efc3b02
commit d74f2c8972
2 changed files with 4 additions and 0 deletions

View File

@ -39,6 +39,7 @@ void CPPCodeGenerator::writef(const char* s, va_list va) {
vsprintf(heap.get(), s, copy);
fOut->write(heap.get(), length);
}
va_end(copy);
}
void CPPCodeGenerator::writef(const char* s, ...) {

View File

@ -22,6 +22,7 @@ String String::printf(const char* fmt, ...) {
va_start(args, fmt);
String result;
result.vappendf(fmt, args);
va_end(args);
return result;
}
@ -30,6 +31,7 @@ void String::appendf(const char* fmt, ...) {
va_list args;
va_start(args, fmt);
this->vappendf(fmt, args);
va_end(args);
}
#endif
@ -51,6 +53,7 @@ void String::vappendf(const char* fmt, va_list args) {
VSNPRINTF(newBuffer.get(), size + 1, fmt, reuse);
this->append(newBuffer.get(), size);
}
va_end(reuse);
}