libftdi-git Archives

Subject: port libftdi to libusb-1.0 branch, master, updated. v0.17-29-g95ac1ca

From: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
To: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
Date: Mon, 14 Jun 2010 09:29:03 +0200 (CEST)
The branch, master has been updated
       via  95ac1ca2f571a87170fa5578412ef5cb64a941e0 (commit)
      from  705f012d7f828e212986c21f30abb2c12cb8068a (commit)


- Log -----------------------------------------------------------------
commit 95ac1ca2f571a87170fa5578412ef5cb64a941e0
Author: Wilfried Holzke <libftdi@xxxxxxxxxx>
Date:   Mon Jun 14 09:20:14 2010 +0200

    Add ftdi_eeprom_free() to free allocated memory in eeprom

-----------------------------------------------------------------------

Summary of changes:
 AUTHORS    |    1 +
 src/ftdi.c |   21 +++++++++++++++++++++
 src/ftdi.h |    1 +
 3 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 506ff18..9aed93e 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -38,3 +38,4 @@ see Changelog for full details:
   Thomas Fischl <fischl@xxxxxxxxx>
   Tim Ansell <mithro@xxxxxxxxxx>
   Uwe Bonnes <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
+  Wilfried Holzke <libftdi@xxxxxxxxxx>
diff --git a/src/ftdi.c b/src/ftdi.c
index b977b77..7f7e5a0 100644
--- a/src/ftdi.c
+++ b/src/ftdi.c
@@ -2205,6 +2205,27 @@ void ftdi_eeprom_initdefaults(struct ftdi_eeprom *eeprom)
 }
 
 /**
+    Frees allocated memory in eeprom.
+
+    \param eeprom Pointer to ftdi_eeprom
+*/
+void ftdi_eeprom_free(struct ftdi_eeprom *eeprom)
+{
+    if (eeprom->manufacturer != 0) {
+        free(eeprom->manufacturer);
+        eeprom->manufacturer = 0;
+    }
+    if (eeprom->product != 0) {
+        free(eeprom->product);
+        eeprom->product = 0;
+    }
+    if (eeprom->serial != 0) {
+        free(eeprom->serial);
+        eeprom->serial = 0;
+    }
+}
+
+/**
     Build binary output from ftdi_eeprom structure.
     Output is suitable for ftdi_write_eeprom().
 
diff --git a/src/ftdi.h b/src/ftdi.h
index e7c2268..aaa7744 100644
--- a/src/ftdi.h
+++ b/src/ftdi.h
@@ -384,6 +384,7 @@ extern "C"
 
     /* init and build eeprom from ftdi_eeprom structure */
     void ftdi_eeprom_initdefaults(struct ftdi_eeprom *eeprom);
+    void ftdi_eeprom_free(struct ftdi_eeprom *eeprom);
     int ftdi_eeprom_build(struct ftdi_eeprom *eeprom, unsigned char *output);
     int ftdi_eeprom_decode(struct ftdi_eeprom *eeprom, unsigned char *output, 
int size);
 


hooks/post-receive
-- 
port libftdi to libusb-1.0

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

Current Thread
  • port libftdi to libusb-1.0 branch, master, updated. v0.17-29-g95ac1ca, libftdi-git <=