mixed up delete[] and free()
TODO and autogen.sh added