if (avail < 1024) {
if (VIR_REALLOC_N(con->streamToTerminal.data,
con->streamToTerminal.length + 1024) < 0) {
- virReportOOMError();
virConsoleShutdown(con);
return;
}
if (avail < 1024) {
if (VIR_REALLOC_N(con->terminalToStream.data,
con->terminalToStream.length + 1024) < 0) {
- virReportOOMError();
virConsoleShutdown(con);
return;
}
old_sigpipe = signal(SIGPIPE, do_signal);
got_signal = 0;
- if (VIR_ALLOC(con) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC(con) < 0)
goto cleanup;
- }
con->escapeChar = vshGetEscapeChar(escape_seq);
con->st = virStreamNew(virDomainGetConnect(dom),
}
if (VIR_ALLOC_N(params, nparams * MIN(show_count, 128)) < 0)
- goto no_memory;
+ goto cleanup;
while (show_count) {
int ncpus = MIN(show_count, 128);
}
if (VIR_ALLOC_N(params, nparams) < 0)
- goto no_memory;
+ goto cleanup;
/* passing start_cpu == -1 gives us domain's total status */
if ((nparams = virDomainGetCPUStats(dom, params, nparams, -1, 1, flags)) < 0)
virDomainFree(dom);
return ret;
-no_memory:
- virReportOOMError();
- goto cleanup;
-
failed_stats:
vshError(ctl, _("Failed to retrieve CPU statistics for domain '%s'"),
virDomainGetName(dom));
for (iter = 0; scheme[iter] != NULL; iter++) {
/* Create our XPATH lookup for the current display's port */
if (virAsprintf(&xpath, xpath_fmt, scheme[iter], "port") < 0)
- goto no_memory;
+ goto cleanup;
/* Attempt to get the port number for the current graphics scheme */
tmp = virXPathInt(xpath, ctxt, &port);
/* Create our XPATH lookup for the current display's address */
if (virAsprintf(&xpath, xpath_fmt, scheme[iter], "listen") < 0)
- goto no_memory;
+ goto cleanup;
/* Attempt to get the listening addr if set for the current
* graphics scheme */
/* Create our XPATH lookup for the password */
if (virAsprintf(&xpath, xpath_fmt, scheme[iter], "passwd") < 0)
- goto no_memory;
+ goto cleanup;
/* Attempt to get the password */
passwd = virXPathString(xpath, ctxt);
/* Create our XPATH lookup for TLS Port (automatically skipped
* for unsupported schemes */
if (virAsprintf(&xpath, xpath_fmt, scheme[iter], "tlsPort") < 0)
- goto no_memory;
+ goto cleanup;
/* Attempt to get the TLS port number */
tmp = virXPathInt(xpath, ctxt, &tls_port);
xmlFreeDoc(xml);
virDomainFree(dom);
return ret;
-
-no_memory:
- virReportOOMError();
- goto cleanup;
}
/*
if (n1_child_size == 0 && n2_child_size == 0)
return true;
- if (!(bitmap = virBitmapNew(n1_child_size))) {
- virReportOOMError();
+ if (!(bitmap = virBitmapNew(n1_child_size)))
return false;
- }
child2 = n2->children;
while (child2) {
VIR_FREE(disk_type);
if (xml_buf) {
int len = xmlBufferLength(xml_buf);
- if (VIR_ALLOC_N(ret, len + 1) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC_N(ret, len + 1) < 0)
return NULL;
- }
memcpy(ret, (char *)xmlBufferContent(xml_buf), len);
ret[len] = '\0';
xmlBufferFree(xml_buf);