From c2909feea20a33cd06875442141d7038e9be28f9 Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Fri, 25 Jun 2010 17:38:18 +0200 Subject: [PATCH] Don't crash in ftdi_eeprom_free() if eeprom is unallocated/already freed --- src/ftdi.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/ftdi.c b/src/ftdi.c index 4d10b73..2db8d32 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -2138,6 +2138,9 @@ void ftdi_eeprom_initdefaults(struct ftdi_eeprom *eeprom) */ void ftdi_eeprom_free(struct ftdi_eeprom *eeprom) { + if (!eeprom) + return; + if (eeprom->manufacturer != 0) { free(eeprom->manufacturer); eeprom->manufacturer = 0; -- 1.7.1