static inline const unsigned char *ReadResourceByte(const unsigned char *p,
  unsigned char *quantum)
{
  *quantum=(*p++);
  return(p);
}

The product calls free() twice on the same memory address, potentially leading to modification of unexpected memory locations.