]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/norma-dmm/api.c
Consistently use g_malloc0() for allocating devc.
[libsigrok.git] / src / hardware / norma-dmm / api.c
index 2f56441af5f11da231141051bc75be152f7db17d..a0e53fc4d1b2983e729b9e3f2bc80ae6c74fc364 100644 (file)
@@ -149,14 +149,10 @@ static GSList *do_scan(struct sr_dev_driver* drv, GSList *options)
                        sdi->vendor = g_strdup(get_brandstr(drv));
                        sdi->model = g_strdup(get_typestr(auxtype, drv));
                        sdi->version = g_strdup(buf + 9);
-                       if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
-                               sr_err("Device context malloc failed.");
-                               return NULL;
-                       }
+                       devc = g_malloc0(sizeof(struct dev_context));
                        devc->type = auxtype;
                        devc->version = g_strdup(&buf[9]);
                        devc->elapsed_msec = g_timer_new();
-
                        sdi->conn = serial;
                        sdi->priv = devc;
                        sdi->driver = drv;