提交 72919f3d 编写于 作者: J Jim Meyering

virBufferVSprintf: do not omit va_end(argptr) call

* src/util/buf.c (virBufferVSprintf): Do not omit va_end(argptr).
Improved-by: Daniel Veillard.
上级 14ee6a66
......@@ -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';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册