From: Uwe Bonnes Date: Wed, 8 Sep 2010 12:58:43 +0000 (+0200) Subject: Correct ftdi_eeprom_free() X-Git-Tag: v1.0rc1~133^2~128 X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=commitdiff_plain;h=6e73861dd69c21fd9eb56095f09ff2baaca8694c Correct ftdi_eeprom_free() --- 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; + } } }