...
This example can be corrected many different ways depending on the intent of the programmer. In this compliant solution, p2
is found to be extraneous. The calls to bar()
and baz()
can be removed if they do not produce any side - effects.
Code Block | ||
---|---|---|
| ||
int *p1 = foo(); /* Removable if bar() does not produce any side- effects */ bar(); /* Removable if baz() does not produce any side- effects */ baz(); return p1; |
Risk Assessment
...