]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/pipistrello-ols/api.c
Some more g_try_*alloc() fixes.
[libsigrok.git] / src / hardware / pipistrello-ols / api.c
index defb39785d32eb994fd954ba55f1598360ddb90c..b84ff193ea8404bbb47ae47ca9eb6aa19bbae140 100644 (file)
@@ -110,10 +110,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        devc->flag_reg = 0;
 
        /* Allocate memory for the incoming ftdi data. */
-       if (!(devc->ftdi_buf = g_try_malloc0(FTDI_BUF_SIZE))) {
-               sr_err("ftdi_buf malloc failed.");
-               goto err_free_devc;
-       }
+       devc->ftdi_buf = g_malloc0(FTDI_BUF_SIZE);
 
        /* Allocate memory for the FTDI context (ftdic) and initialize it. */
        if (!(devc->ftdic = ftdi_new())) {
@@ -197,7 +194,6 @@ err_free_ftdic:
        ftdi_free(devc->ftdic); /* NOT free() or g_free()! */
 err_free_ftdi_buf:
        g_free(devc->ftdi_buf);
-err_free_devc:
        g_free(devc);
 
        return NULL;