X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fkecheng-kc-330b%2Fapi.c;h=721ceda12937045c100794fce79147d88d118210;hb=0af636bed97c174bea46e61e961eaa1b0b162e0f;hp=0e5baef5ea697079dede396d27f09a75efa6c9ca;hpb=c7e455625807d31fcaf95f36a23f1afeba033e1f;p=libsigrok.git diff --git a/src/hardware/kecheng-kc-330b/api.c b/src/hardware/kecheng-kc-330b/api.c index 0e5baef5..721ceda1 100644 --- a/src/hardware/kecheng-kc-330b/api.c +++ b/src/hardware/kecheng-kc-330b/api.c @@ -129,10 +129,10 @@ static GSList *scan(GSList *options) for (l = usb_devices; l; l = l->next) { if (scan_kecheng(l->data, &model) != SR_OK) continue; - if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, VENDOR, - model, NULL))) - return NULL; - g_free(model); + sdi = sr_dev_inst_new(); + sdi->status = SR_ST_INACTIVE; + sdi->vendor = g_strdup(VENDOR); + sdi->model = model; /* Already g_strndup()'d. */ sdi->driver = di; sdi->inst_type = SR_INST_USB; sdi->conn = l->data;