Fixed memory leaks for non-solaris compilers.
astyle formatting