X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fikalogic-scanalogic2%2Fapi.c;h=798ae8bd9468d7414aed939ddd924ee308b48c08;hb=5fabeeac6af940b52f67ac8c925952accc9b39b3;hp=d459210f12a0cfcfbc7682d7c6ec2a68e9b7691e;hpb=0af636bed97c174bea46e61e961eaa1b0b162e0f;p=libsigrok.git diff --git a/src/hardware/ikalogic-scanalogic2/api.c b/src/hardware/ikalogic-scanalogic2/api.c index d459210f..798ae8bd 100644 --- a/src/hardware/ikalogic-scanalogic2/api.c +++ b/src/hardware/ikalogic-scanalogic2/api.c @@ -91,11 +91,7 @@ static GSList *scan(GSList *options) 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."); @@ -112,7 +108,7 @@ static GSList *scan(GSList *options) 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);