]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/uni-t-ut32x/api.c
Consistently use g_malloc0() for allocating devc.
[libsigrok.git] / src / hardware / uni-t-ut32x / api.c
index 95096c0b60d8e0c8c776ef8e79037c0afbd0f444..8c04e64a842c6fe96f656d21f5fb46cab6316d9b 100644 (file)
@@ -94,11 +94,7 @@ static GSList *scan(GSList *options)
                                }
                                sdi->channels = g_slist_append(sdi->channels, ch);
                        }
-
-                       if (!(devc = g_try_malloc(sizeof(struct dev_context)))) {
-                               sr_dbg("Device context malloc failed.");
-                               return NULL;
-                       }
+                       devc = g_malloc0(sizeof(struct dev_context));
                        sdi->priv = devc;
                        devc->limit_samples = 0;
                        devc->data_source = DEFAULT_DATA_SOURCE;