mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
qemu: fix memleak in virCapabilitiesDomainDataLookup
virBufferContentAndReset() doesn't free buf contents, we should use virBufferFreeAndReset() to get buf freed. Signed-off-by: Zhang Bo <oscar.zhangbo@huawei.com>
This commit is contained in:
parent
0a8bd97afa
commit
768ec8c16d
@ -701,13 +701,14 @@ virCapabilitiesDomainDataLookup(virCapsPtr caps,
|
||||
!virBufferCurrentContent(&buf)[0])
|
||||
virBufferAsprintf(&buf, "%s", _("any configuration"));
|
||||
if (virBufferCheckError(&buf) < 0) {
|
||||
virBufferContentAndReset(&buf);
|
||||
virBufferFreeAndReset(&buf);
|
||||
goto error;
|
||||
}
|
||||
|
||||
virReportError(VIR_ERR_INVALID_ARG,
|
||||
_("could not find capabilities for %s"),
|
||||
virBufferContentAndReset(&buf));
|
||||
virBufferCurrentContent(&buf));
|
||||
virBufferFreeAndReset(&buf);
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user