X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Flcr%2Fes51919.c;h=d15c4d3820e18756b0ae0353ab58fcbd8172d214;hb=f57d8ffe66612a1fdc20ed09c222f8ea59bd84d4;hp=4cacbe9a134c84d54fb2f4fa46d23e1934a1a6d8;hpb=0af636bed97c174bea46e61e961eaa1b0b162e0f;p=libsigrok.git diff --git a/src/lcr/es51919.c b/src/lcr/es51919.c index 4cacbe9a..d15c4d38 100644 --- a/src/lcr/es51919.c +++ b/src/lcr/es51919.c @@ -843,15 +843,11 @@ SR_PRIV struct sr_dev_inst *es51919_serial_scan(GSList *options, sr_info("Found device on port %s.", serial->port); - sdi = sr_dev_inst_new(); + sdi = g_malloc0(sizeof(struct sr_dev_inst)); sdi->status = SR_ST_INACTIVE; sdi->vendor = g_strdup(vendor); sdi->model = g_strdup(model); - - if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { - sr_err("Device context malloc failed."); - goto scan_cleanup; - } + devc = g_malloc0(sizeof(struct dev_context)); if (!(devc->buf = dev_buffer_new(PACKET_SIZE * 8))) goto scan_cleanup;