X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhardware%2Fsaleae-logic16%2Fapi.c;h=21ccd557b69a6865e8d1a6962f221d41cf9c647a;hb=f57d8ffe66612a1fdc20ed09c222f8ea59bd84d4;hp=f151fbd9243df42443c815052ab221a934b47841;hpb=0af636bed97c174bea46e61e961eaa1b0b162e0f;p=libsigrok.git diff --git a/src/hardware/saleae-logic16/api.c b/src/hardware/saleae-logic16/api.c index f151fbd9..21ccd557 100644 --- a/src/hardware/saleae-logic16/api.c +++ b/src/hardware/saleae-logic16/api.c @@ -198,7 +198,7 @@ static GSList *scan(GSList *options) if (des.idVendor != LOGIC16_VID || des.idProduct != LOGIC16_PID) continue; - sdi = sr_dev_inst_new(); + sdi = g_malloc0(sizeof(struct sr_dev_inst)); sdi->status = SR_ST_INITIALIZING; sdi->vendor = g_strdup("Saleae"); sdi->model = g_strdup("Logic16"); @@ -212,8 +212,7 @@ static GSList *scan(GSList *options) sdi->channels = g_slist_append(sdi->channels, ch); } - if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) - return NULL; + devc = g_malloc0(sizeof(struct dev_context)); devc->selected_voltage_range = VOLTAGE_RANGE_18_33_V; sdi->priv = devc; drvc->instances = g_slist_append(drvc->instances, sdi);