]> sigrok.org Git - libsigrok.git/blobdiff - src/lcr/es51919.c
Consistently use g_malloc0() for allocating devc.
[libsigrok.git] / src / lcr / es51919.c
index ecfcd0ed7a5a0f703f83a139e3f5420fcf9c2537..d15c4d3820e18756b0ae0353ab58fcbd8172d214 100644 (file)
@@ -847,11 +847,7 @@ SR_PRIV struct sr_dev_inst *es51919_serial_scan(GSList *options,
        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;