Install fixes.
No need for log in source files.
Memory fixes.

malloc instead of new.
Check return value.
Free on return.