From: Gerhard Sittig Date: Fri, 9 Feb 2018 18:22:14 +0000 (+0100) Subject: norma-dmm: fix a potential memory leak X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=8eadb70a37946c268d9bef312478096e96009c3d;p=libsigrok.git norma-dmm: fix a potential memory leak Release an allocated buffer in an error path. This was reported by clang's scan-build. --- diff --git a/src/hardware/norma-dmm/api.c b/src/hardware/norma-dmm/api.c index 86cbd9c3..d155bc36 100644 --- a/src/hardware/norma-dmm/api.c +++ b/src/hardware/norma-dmm/api.c @@ -110,6 +110,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;