serial: Fix leak in serial_open.
A new sp_port is created every time we call serial_open (sp_get_port_by_name implicitly creates one for us), so free it every time we call serial_close.
This commit is contained in:
parent
90c7f4e92d
commit
066d42b1c8
|
@ -110,6 +110,7 @@ SR_PRIV int serial_close(struct sr_serial_dev_inst *serial)
|
|||
sr_spew("Closing serial port %s (fd %d).", serial->port, serial->fd);
|
||||
|
||||
ret = sp_close(serial->data);
|
||||
sp_free_port(serial->data);
|
||||
|
||||
switch (ret) {
|
||||
case SP_ERR_ARG:
|
||||
|
|
Loading…
Reference in New Issue