Add missing check for NULL product string
[libftdi] / 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)