libftdi Archives

Subject: [Revisited^2] libftdi-1.0: Reduce memory leaks[1/2]

From: Uwe Bonnes <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Tue, 8 Jun 2010 13:43:49 +0200
Hallo Thomas,

please use this patch and not the ones sent June 7.

The first patch is clear:
At exit we must call libusb_exit(NULL) to avoid memory leaks.

Bye
-- 
Uwe Bonnes                bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
>From a88ea1d453496be28626a59e3dd19cac0f5d584d Mon Sep 17 00:00:00 2001
From: Uwe Bonnes <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 8 Jun 2010 12:24:19 +0200
Subject: libusb_init() needs libusb_exit() to avoid leak

---
 src/ftdi.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/ftdi.c b/src/ftdi.c
index 7b4b987..69e5068 100644
--- a/src/ftdi.c
+++ b/src/ftdi.c
@@ -185,6 +185,7 @@ void ftdi_deinit(struct ftdi_context *ftdi)
         free(ftdi->readbuffer);
         ftdi->readbuffer = NULL;
     }
+    libusb_exit(NULL);
 }
 
 /**
-- 
1.6.4.2


--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread
  • [Revisited^2] libftdi-1.0: Reduce memory leaks[1/2], Uwe Bonnes <=