Add missing check for NULL product string
authorUwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Mon, 20 Jun 2011 13:16:05 +0000 (15:16 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Tue, 21 Jun 2011 07:51:08 +0000 (09:51 +0200)
src/ftdi.c

index 5cb3ca5..0893421 100644 (file)
@@ -2226,6 +2226,7 @@ int ftdi_eeprom_initdefaults(struct ftdi_context *ftdi, char * manufacturer,
     if (eeprom->product)
         free (eeprom->product);
     eeprom->product = NULL;
+    if(product)
     {
         eeprom->product = malloc(strlen(product)+1);
         if (eeprom->product)