]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/agilent-dmm/api.c
Consistently use g_malloc0() for allocating devc.
[libsigrok.git] / src / hardware / agilent-dmm / api.c
index e8767a61ae7c2c2451ec1ae9c7aff999121492c5..a41e730a4a1c675b63bac76d972b38a02fab98bd 100644 (file)
@@ -144,10 +144,7 @@ static GSList *scan(GSList *options)
                        sdi->vendor = g_strdup("Agilent");
                        sdi->model = g_strdup(tokens[1]);
                        sdi->version = g_strdup(tokens[3]);
-                       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->profile = &supported_agdmm[i];
                        devc->cur_mq = -1;
                        sdi->inst_type = SR_INST_SERIAL;