mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
C++: add good example for DeadCodeGoto
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
goto err;
|
||||
free(pointer);
|
||||
err: return -1;
|
||||
goto err1;
|
||||
free(pointer); // BAD: this line is unreachable
|
||||
err1: return -1;
|
||||
|
||||
free(pointer); // GOOD: this line is reachable
|
||||
goto err2;
|
||||
err2: return -1;
|
||||
|
||||
Reference in New Issue
Block a user