X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fgmc-mh-1x-2x%2Fapi.c;h=f2cbd7b20ae4d0b8e4117af4f41a5aabb434df3f;hb=969671a542f3af8d918e57205e80670a11e8c1fa;hp=bfb211d5c6ec6447a3b7dc332caa034e5ed8d2fc;hpb=dd7a72ea697a172032f5473b0ddff5e8d47222f4;p=libsigrok.git diff --git a/src/hardware/gmc-mh-1x-2x/api.c b/src/hardware/gmc-mh-1x-2x/api.c index bfb211d5..f2cbd7b2 100644 --- a/src/hardware/gmc-mh-1x-2x/api.c +++ b/src/hardware/gmc-mh-1x-2x/api.c @@ -300,11 +300,9 @@ static GSList *scan_2x_bd232(struct sr_dev_driver *di, GSList *options) } }; - /* Free last alloc if no device found */ - if (devc->model == METRAHIT_NONE) { - g_free(devc); - sr_dev_inst_free(sdi); - } + /* Free last alloc that was done in preparation. */ + g_free(devc); + sr_dev_inst_free(sdi); return std_scan_complete(di, devices);