mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
remove redundant calls to virBufferFreeAndReset()
There are several calls to virBufferFreeAndReset() when functions encounter an error, but the caller never uses the virBuffer once an error has been encountered (all callers detect error by looking at the function return value, not the contents of the virBuffer being operated on), and now that all virBuffers are auto-freed there is no reason for the lower level functions like these to spend time freeing a buffer that is guaranteed to be freed momentarily anyway. Signed-off-by: Laine Stump <laine@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
f0f7ad14e9
commit
065f7d5ba9
@ -493,7 +493,6 @@ virDomainCheckpointDefFormatInternal(virBufferPtr buf,
|
||||
return 0;
|
||||
|
||||
error:
|
||||
virBufferFreeAndReset(buf);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -29970,7 +29970,6 @@ virDomainDefFormatInternalSetRootName(virDomainDefPtr def,
|
||||
return 0;
|
||||
|
||||
error:
|
||||
virBufferFreeAndReset(buf);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -916,7 +916,6 @@ virDomainSnapshotDefFormatInternal(virBufferPtr buf,
|
||||
return 0;
|
||||
|
||||
error:
|
||||
virBufferFreeAndReset(buf);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1432,7 +1432,6 @@ xenFormatXLVnode(virConfValuePtr list,
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
virBufferFreeAndReset(buf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1581,7 +1581,6 @@ virSysinfoFormat(virBufferPtr buf, virSysinfoDefPtr def)
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unexpected sysinfo type model %d"),
|
||||
def->type);
|
||||
virBufferFreeAndReset(buf);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1284,7 +1284,6 @@ virXMLValidatorValidate(virXMLValidatorPtr validator,
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
virBufferFreeAndReset(&validator->buf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user