Fixed issue malloc free