X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fpipistrello-ols%2Fapi.c;fp=src%2Fhardware%2Fpipistrello-ols%2Fapi.c;h=b84ff193ea8404bbb47ae47ca9eb6aa19bbae140;hb=a95f142e88fa5368adfabf87544acfdeed7d7604;hp=defb39785d32eb994fd954ba55f1598360ddb90c;hpb=1a46cc62e2b528bcaeb1f8dc0c952a81b3bcba5c;p=libsigrok.git diff --git a/src/hardware/pipistrello-ols/api.c b/src/hardware/pipistrello-ols/api.c index defb3978..b84ff193 100644 --- a/src/hardware/pipistrello-ols/api.c +++ b/src/hardware/pipistrello-ols/api.c @@ -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;