Scott Moser <smoser@ubuntu.com>
Guannan Ren <gren@redhat.com>
John Williams <john.williams@petalogix.com>
+ Michael Santos <michael.santos@gmail.com>
[....send patches to get your name here....]
else
feature = strdup(p);
+ if (!feature)
+ goto no_memory;
+
ret = virCPUDefAddFeature(cpu, feature, policy);
VIR_FREE(feature);
if (ret < 0)
if (STREQ(arg, "-cdrom")) {
disk->device = VIR_DOMAIN_DISK_DEVICE_CDROM;
disk->dst = strdup("hdc");
+ if (!disk->dst)
+ goto no_memory;
disk->readonly = 1;
} else {
if (STRPREFIX(arg, "-fd")) {
disk->bus = VIR_DOMAIN_DISK_BUS_SCSI;
}
disk->dst = strdup(arg + 1);
+ if (!disk->dst)
+ goto no_memory;
}
disk->src = strdup(val);
+ if (!disk->src)
+ goto no_memory;
if (disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK) {
char *host, *port;
goto error;
}
*port++ = '\0';
- if (VIR_ALLOC(disk->hosts) < 0) {
- virReportOOMError();
- goto error;
- }
+ if (VIR_ALLOC(disk->hosts) < 0)
+ goto no_memory;
disk->nhosts = 1;
disk->hosts->name = host;
disk->hosts->port = strdup(port);
- if (!disk->hosts->port) {
- virReportOOMError();
- goto error;
- }
+ if (!disk->hosts->port)
+ goto no_memory;
+ VIR_FREE(disk->src);
disk->src = NULL;
break;
case VIR_DOMAIN_DISK_PROTOCOL_RBD:
goto error;
}
*vdi++ = '\0';
- if (VIR_ALLOC(disk->hosts) < 0) {
- virReportOOMError();
- goto error;
- }
+ if (VIR_ALLOC(disk->hosts) < 0)
+ goto no_memory;
disk->nhosts = 1;
disk->hosts->name = disk->src;
disk->hosts->port = strdup(port);
- if (!disk->hosts->port) {
- virReportOOMError();
- goto error;
- }
+ if (!disk->hosts->port)
+ goto no_memory;
disk->src = strdup(vdi);
- if (!disk->src) {
- virReportOOMError();
- goto error;
- }
+ if (!disk->src)
+ goto no_memory;
}
break;
}