mirror of
https://github.com/linux-msm/openocd.git
synced 2026-02-25 13:15:07 -08:00
drivers/linuxspidev: fix minor memory leak
free() strduped spi_path on quit.
Found by valgrind.
Change-Id: Iaa59c7258c920b5e60d615df790dfe815831b925
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Fixes: 83e0293f7b ("Add Linux SPI device SWD adapter support")
Reviewed-on: https://review.openocd.org/c/openocd/+/8732
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Richard Pasek <rpasek@google.com>
This commit is contained in:
@@ -337,6 +337,10 @@ static int spidev_quit(void)
|
||||
|
||||
close(spi_fd);
|
||||
spi_fd = -1;
|
||||
|
||||
free(spi_path);
|
||||
spi_path = NULL;
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user