Is it possible to have the git patches so to test it and compare it
with what I did ?
(For all parts)
On Thu, 9 Jun 2011 12:25:36 +0200, Peter Stuge wrote:
ft2232_init() fails if the command buffer can not be allocated, but
ft2232_quit() will be called to clean up, so the command buffer must
be free():d only if it has been successfully allocated.
---
src/jtag/drivers/ft2232.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/jtag/drivers/ft2232.c b/src/jtag/drivers/ft2232.c
index 9315eff..aba7f14 100644
--- a/src/jtag/drivers/ft2232.c
+++ b/src/jtag/drivers/ft2232.c
@@ -2459,6 +2459,8 @@ static int ft2232_init(void)
ft2232_buffer_size = 0;
ft2232_buffer = malloc(FT2232_BUFFER_SIZE);
+ if (!ft2232_buffer)
+ goto quit;
if (layout->init() != ERROR_OK)
goto quit;
@@ -3225,7 +3227,8 @@ static int ft2232_quit(void)
ftdi_deinit(&ftdic);
#endif
- free(ft2232_buffer);
+ if (ft2232_buffer)
+ free(ft2232_buffer);
ft2232_buffer = NULL;
return ERROR_OK;
--
Regards,
Sébastien Farquet
http://www.amontec.com/
Amontec JTAGkey-2 : High speed USB JTAG interface
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development