提交 14b74ab6 编写于 作者: M Michal Privoznik

virBuffer: Try harder to free buffer

Currently, the way virBufferFreeAndReset() works is it relies on
virBufferContentAndReset() to fetch the buffer content which is
then freed. This works as long as there is no bug in virBuffer*
implementation (not true apparently). Explicitly call free() over
buffer content.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NErik Skultety <eskultet@redhat.com>
上级 39d4f78a
......@@ -281,9 +281,8 @@ virBufferContentAndReset(virBufferPtr buf)
*/
void virBufferFreeAndReset(virBufferPtr buf)
{
char *str = virBufferContentAndReset(buf);
VIR_FREE(str);
if (buf)
virBufferSetError(buf, 0);
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册