]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/center-3xx/api.c
Consistently use g_malloc0() for allocating devc.
[libsigrok.git] / src / hardware / center-3xx / api.c
index 13831c05a9af4b7b90e4771a31e2587e5bd78d61..8118a2b1f5ef099b49e066fe1ce97cac170079e9 100644 (file)
@@ -92,15 +92,9 @@ static GSList *center_scan(const char *conn, const char *serialcomm, int idx)
        sdi->status = SR_ST_INACTIVE;
        sdi->vendor = g_strdup(center_devs[idx].vendor);
        sdi->model = g_strdup(center_devs[idx].device);
-
-       if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
-               sr_err("Device context malloc failed.");
-               goto scan_cleanup;
-       }
-
+       devc = g_malloc0(sizeof(struct dev_context));
        sdi->inst_type = SR_INST_SERIAL;
        sdi->conn = serial;
-
        sdi->priv = devc;
        sdi->driver = center_devs[idx].di;