diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 2c674a8a7044b3d9b257df25f1ff22c8b2f8b375..922741fe256768083651e7e3af0b60bbf3d5ae75 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -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; }