norma-dmm: fix a potential memory leak

Release an allocated buffer in an error path.

This was reported by clang's scan-build.
This commit is contained in:
Gerhard Sittig 2018-02-09 19:22:14 +01:00 committed by Uwe Hermann
parent e4924d752b
commit 8eadb70a37
1 changed files with 1 additions and 0 deletions

View File

@ -110,6 +110,7 @@ static GSList *scan(struct sr_dev_driver *drv, GSList *options)
if (serial_write_blocking(serial, req, strlen(req), if (serial_write_blocking(serial, req, strlen(req),
serial_timeout(serial, strlen(req))) < 0) { serial_timeout(serial, strlen(req))) < 0) {
sr_err("Unable to send identification request."); sr_err("Unable to send identification request.");
g_free(buf);
return NULL; return NULL;
} }
len = BUF_MAX; len = BUF_MAX;