Skip to content

Commit

Permalink
iiod: iiod-serial: Fix memory leak
Browse files Browse the repository at this point in the history
In the function start_serial_daemon, the "dev" variable was never freed
when the thread was successfully created.

Signed-off-by: Paul Cercueil <[email protected]>
  • Loading branch information
pcercuei committed Mar 4, 2022
1 parent 0152a9a commit dda3a8b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions iiod/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ int start_serial_daemon(struct iio_context *ctx, const char *uart_params,
if (err)
goto err_close_fd;

free(dev);

return 0;

err_close_fd:
Expand Down

0 comments on commit dda3a8b

Please sign in to comment.