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

@@ -728,10 +728,8 @@ int virNetSocketNewConnectSSH(const char *nodename,
virCommandAddArgList(cmd, nodename, "sh", "-c", NULL);
virBufferEscapeShell(&buf, netcat);
if (virBufferError(&buf)) {
if (virBufferCheckError(&buf) < 0) {
virCommandFree(cmd);
virBufferFreeAndReset(&buf);
virReportOOMError();
return -1;
}
quoted = virBufferContentAndReset(&buf);