Fix all malloc and other potential memory problem (work-in-process)

- [x] Remove unnecessary casts of the return of `malloc()`
- [ ] Check and handle **every** return of `malloc()`, success or failure, life or death