]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/ikalogic-scanalogic2/api.c
Consistently use g_malloc0() for allocating devc.
[libsigrok.git] / src / hardware / ikalogic-scanalogic2 / api.c
index 380443c48304091d3d07ad4ed3cfcf8c8e8e8ac2..798ae8bd9468d7414aed939ddd924ee308b48c08 100644 (file)
@@ -91,11 +91,7 @@ static GSList *scan(GSList *options)
                        continue;
                }
 
-               if (!(devc = g_try_malloc(sizeof(struct dev_context)))) {
-                       sr_err("Device instance malloc failed.");
-                       sr_usb_dev_inst_free(usb);
-                       continue;
-               }
+               devc = g_malloc0(sizeof(struct dev_context));
 
                if (!(devc->xfer_in = libusb_alloc_transfer(0))) {
                        sr_err("Transfer malloc failed.");