mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Use virBufferCheckError everywhere we report OOM error
Replace:
if (virBufferError(&buf)) {
virBufferFreeAndReset(&buf);
virReportOOMError();
...
}
with:
if (virBufferCheckError(&buf) < 0)
...
This should not be a functional change (unless some callers
misused the virBuffer APIs - a different error would be reported
then)
This commit is contained in:
@@ -333,12 +333,8 @@ static int udevGenerateDeviceName(struct udev_device *device,
|
||||
virBufferAsprintf(&buf, "_%s", s);
|
||||
}
|
||||
|
||||
if (virBufferError(&buf)) {
|
||||
virBufferFreeAndReset(&buf);
|
||||
VIR_ERROR(_("Buffer error when generating device name for device "
|
||||
"with sysname '%s'"), udev_device_get_sysname(device));
|
||||
ret = -1;
|
||||
}
|
||||
if (virBufferCheckError(&buf) < 0)
|
||||
return -1;
|
||||
|
||||
def->name = virBufferContentAndReset(&buf);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user