continue;
}
- if (!(devc = g_try_malloc(sizeof(struct dev_context)))) {
- sr_err("Device instance malloc failed.");
- sr_usb_dev_inst_free(usb);
- continue;
- }
+ devc = g_malloc0(sizeof(struct dev_context));
if (!(devc->xfer_in = libusb_alloc_transfer(0))) {
sr_err("Transfer malloc failed.");
continue;
}
- sdi = sr_dev_inst_new();
+ sdi = g_malloc0(sizeof(struct sr_dev_inst));
sdi->status = SR_ST_INACTIVE;
sdi->vendor = g_strdup(VENDOR_NAME);
sdi->model = g_strdup(MODEL_NAME);