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:
Ján Tomko
2014-06-27 10:40:15 +02:00
parent 28b9be2481
commit 92a8e72f9d
51 changed files with 158 additions and 456 deletions

View File

@@ -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);