X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=src%2Fftdi.c;h=2a39a456cb6793accc6d5dc9375e19626c9cfbea;hp=78a7f4e809b907f6b02eee8e53d1b4e625a8a222;hb=6e73861dd69c21fd9eb56095f09ff2baaca8694c;hpb=cc9c9d58811e9efb38d274b5ce3baacfedd0b5d6 diff --git a/src/ftdi.c b/src/ftdi.c index 78a7f4e..2a39a45 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -2223,25 +2223,24 @@ void ftdi_eeprom_initdefaults(struct ftdi_context *ftdi) */ void ftdi_eeprom_free(struct ftdi_context *ftdi) { - struct ftdi_eeprom *eeprom; if (!ftdi) return; if (ftdi->eeprom) - return; - - eeprom = ftdi->eeprom; + { + struct ftdi_eeprom *eeprom = ftdi->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; + 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; + } } }