Fix memory leak in test code
Add shared library libtool exsample