X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Funi-t-ut32x%2Fapi.c;h=95096c0b60d8e0c8c776ef8e79037c0afbd0f444;hb=aac29cc192ccf82b64e77b5e6b11b411da32deed;hp=ab82b779e035b40a1aa1948a5373c7d5189facac;hpb=5827f61b641cfd326a9cf2ea534eb4f9481a8187;p=libsigrok.git diff --git a/src/hardware/uni-t-ut32x/api.c b/src/hardware/uni-t-ut32x/api.c index ab82b779..95096c0b 100644 --- a/src/hardware/uni-t-ut32x/api.c +++ b/src/hardware/uni-t-ut32x/api.c @@ -79,9 +79,10 @@ static GSList *scan(GSList *options) /* We have a list of sr_usb_dev_inst matching the connection * string. Wrap them in sr_dev_inst and we're done. */ for (l = usb_devices; l; l = l->next) { - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, VENDOR, - MODEL, NULL))) - return NULL; + sdi = g_malloc0(sizeof(struct sr_dev_inst)); + sdi->status = SR_ST_INACTIVE; + sdi->vendor = g_strdup(VENDOR); + sdi->model = g_strdup(MODEL); sdi->driver = di; sdi->inst_type = SR_INST_USB; sdi->conn = l->data;