phoenix-rtos / phoenix-rtos-hostutils

Phoenix-RTOS supporting daemon
BSD 3-Clause "New" or "Revised" License
1 stars 5 forks source link

Checking the return value of malloc(). #7

Closed kemonats closed 3 years ago

kemonats commented 4 years ago

Is there any rule when it is checked if 'malloc()' returned 'NULL'. As I can see in the code once it is checked, another time it doesn't.

agkaminski commented 4 years ago

Of course the rule is that the return value of malloc() shall be checked for NULL. There're some instances of optimistic programming in this repository that we'll fix as soon as possible. Thank you.

kemonats commented 4 years ago

In this repository this is probably not so critical, but in the phoenix-rtos-devices repository, yes. I reviewed the code in this repository and in phoenix-rtos-devices and I have some more general insights. If you are interested in my observations, I can present them.