Add support for running with clang's sanitizers.
Fix a memory leak.