devices = NULL;
- if (!(devc = g_try_malloc(sizeof(struct dev_context)))) {
- sr_err("%s: devc malloc failed", __func__);
- return NULL;
- }
+ devc = g_malloc0(sizeof(struct dev_context));
ftdi_init(&devc->ftdic);
devc->use_triggers = 0;
/* Register SIGMA device. */
- sdi = sr_dev_inst_new();
+ sdi = g_malloc0(sizeof(struct sr_dev_inst));
sdi->status = SR_ST_INITIALIZING;
sdi->vendor = g_strdup(USB_VENDOR_NAME);
sdi->model = g_strdup(USB_MODEL_NAME);
for (i = 0; i < ARRAY_SIZE(channel_names); i++) {
ch = sr_channel_new(i, SR_CHANNEL_LOGIC, TRUE,
channel_names[i]);
- if (!ch)
- return NULL;
sdi->channels = g_slist_append(sdi->channels, ch);
}