+Wed Apr 1 11:18:22 BST 2009 Daniel P. Berrange <berrange@redhat.com>
+
+ Misc memory handling fixes
+ * src/node_device.c: Don't strdup() a NULL parent device name
+ * src/qemu_conf.c: Don't try to access() a NULL alternative
+ binary name
+ * src/storage_conf.c: Don't free mode string while its still
+ in use
+
Wed Apr 1 11:16:22 BST 2009 Daniel P. Berrange <berrange@redhat.com>
* src/xm_internal.c: Add support for vifname= parameter in
goto cleanup;
}
- ret = strdup(obj->def->parent);
- if (!ret)
- virReportOOMError(dev->conn);
+ if (obj->def->parent) {
+ ret = strdup(obj->def->parent);
+ if (!ret)
+ virReportOOMError(dev->conn);
+ } else {
+ virNodeDeviceReportError(dev->conn, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("no parent for this device"));
+ }
cleanup:
if (obj)
* which can be used with magic cpu choice
*/
hasbase = (access(info->binary, X_OK) == 0);
- hasaltbase = (access(info->altbinary, X_OK) == 0);
+ hasaltbase = (info->altbinary && access(info->altbinary, X_OK) == 0);
/* Can use acceleration for KVM/KQEMU if
* - host & guest arches match
} else {
char *end = NULL;
perms->mode = strtol(mode, &end, 8);
- VIR_FREE(mode);
if (*end || perms->mode < 0 || perms->mode > 0777) {
+ VIR_FREE(mode);
virStorageReportError(conn, VIR_ERR_XML_ERROR,
"%s", _("malformed octal mode"));
goto error;
}
+ VIR_FREE(mode);
}
if (virXPathNode(conn, "./owner", ctxt) == NULL) {