Non-void function returns void value
The RETVOID.GEN checker finds instances in which a non-void function has an explicit return statement with no value.
Vulnerability and risk
If the returned value is used, it can cause the use of uninitialized memory.
Vulnerable code example
#define OK 1
int func ()
Klocwork flags line 6 in this code, in which the int function func() has a return statement with no value.
Application security training materials provided by Secure Code Warrior.