X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=src%2Fftdi.c;h=7f7e5a0f072376747e2e343b1d056672b9037524;hp=b977b770c7718804d78b3c5d694002fd7d47678c;hb=95ac1ca2f571a87170fa5578412ef5cb64a941e0;hpb=c16b162d5b7a27f6ed2abf847bd6905d0f1755e5 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().