X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fnorma-dmm%2Fapi.c;h=84ca43ca8351c4761309ffc61a949b671ec9c8de;hb=f1a37f39244d97bcd3abb1c29d6a71e9b9edfefe;hp=86cbd9c3d2203bd7733a7559e6a4ae2c1508d858;hpb=dd7a72ea697a172032f5473b0ddff5e8d47222f4;p=libsigrok.git diff --git a/src/hardware/norma-dmm/api.c b/src/hardware/norma-dmm/api.c index 86cbd9c3..84ca43ca 100644 --- a/src/hardware/norma-dmm/api.c +++ b/src/hardware/norma-dmm/api.c @@ -99,8 +99,6 @@ static GSList *scan(struct sr_dev_driver *drv, GSList *options) if (serial_open(serial, SERIAL_RDWR) != SR_OK) return NULL; - serial_flush(serial); - buf = g_malloc(BUF_MAX); snprintf(req, sizeof(req), "%s\r\n", @@ -110,6 +108,7 @@ static GSList *scan(struct sr_dev_driver *drv, GSList *options) if (serial_write_blocking(serial, req, strlen(req), serial_timeout(serial, strlen(req))) < 0) { sr_err("Unable to send identification request."); + g_free(buf); return NULL; } len = BUF_MAX;