virBufferVSprintf: do not omit va_end(argptr) call

* src/util/buf.c (virBufferVSprintf): Do not omit va_end(argptr).
Improved-by: Daniel Veillard.
This commit is contained in:
Jim Meyering 2010-02-18 21:25:01 +01:00
parent 14ee6a66f8
commit 72919f3d35

View File

@ -245,12 +245,15 @@ virBufferVSprintf(const virBufferPtr buf, const char *format, ...)
va_end(locarg);
grow_size = (count > 1000) ? count : 1000;
if (virBufferGrow(buf, grow_size) < 0)
if (virBufferGrow(buf, grow_size) < 0) {
va_end(argptr);
return;
}
size = buf->size - buf->use - 1;
va_copy(locarg, argptr);
}
va_end(argptr);
va_end(locarg);
buf->use += count;
buf->content[buf->use] = '\0';