]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/pipistrello-ols/api.c
Consistently use g_malloc0() for allocating devc.
[libsigrok.git] / src / hardware / pipistrello-ols / api.c
index 2db23fd042eaea1ea39a1de1c194576b5d1d0d78..acbfcda0289606b66be4086ae0ef8c62fc7a6215 100644 (file)
@@ -100,10 +100,7 @@ static GSList *scan(GSList *options)
        devices = NULL;
 
        /* Allocate memory for our private device context. */
-       if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
-               sr_err("Device context malloc failed.");
-               goto err_free_nothing;
-       }
+       devc = g_malloc0(sizeof(struct dev_context));
 
        /* Device-specific settings */
        devc->max_samplebytes = devc->max_samplerate = devc->protocol_version = 0;
@@ -204,7 +201,6 @@ err_free_ftdi_buf:
        g_free(devc->ftdi_buf);
 err_free_devc:
        g_free(devc);
-err_free_nothing:
 
        return NULL;
 }