]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/fx2lafw/protocol.c
Consistently use g_malloc0() for allocating devc.
[libsigrok.git] / src / hardware / fx2lafw / protocol.c
index 7e7b189116c565bd6b7f352de84e340bdb247fe6..1a623ec63de1698eb65e38193b6f1ca9d05c9855 100644 (file)
@@ -299,11 +299,7 @@ SR_PRIV struct dev_context *fx2lafw_dev_new(void)
 {
        struct dev_context *devc;
 
-       if (!(devc = g_try_malloc(sizeof(struct dev_context)))) {
-               sr_err("Device context malloc failed.");
-               return NULL;
-       }
-
+       devc = g_malloc0(sizeof(struct dev_context));
        devc->profile = NULL;
        devc->fw_updated = 0;
        devc->cur_samplerate = 0;