X-Git-Url: http://developer.intra2net.com/git/?a=blobdiff_plain;f=src%2Fftdi.c;h=4d10b73aa8350ded4541cbfff4864b30cd0cf261;hb=4aee4ad2acf69807605ced163e54667265100273;hp=756e6b7cb5ed0f3aa8ca2bac39ea0f980873b25b;hpb=8cb3662899f555fb424668e1726c9b3e1e41f7e8;p=libftdi diff --git a/src/ftdi.c b/src/ftdi.c index 756e6b7..4d10b73 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -2132,6 +2132,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().