Handle input binaries up to 2^32 bytes, rather than 2^16 bytes.
Fix the memory leak.