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:
parent
e4924d752b
commit
8eadb70a37
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue