General fixes to libhybris

* Fixed a memory leak
* Fix non void return
* Fix warning due to missing include