Skip to content

Commit 3195f0c

Browse files
committed
Use more specific hasGlobalName() for stdlib function free(3)
Based on the CodeQL documentation's example of strncpy(3) and strlen(3): https://codeql.github.com/docs/codeql-language-guides/hash-consing-and-value-numbering/#example-query
1 parent d7c784e commit 3195f0c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cpp/ql/src/experimental/Best Practices/GuardedFree.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import cpp
1515

1616
class FreeCall extends FunctionCall {
17-
FreeCall() { this.getTarget().hasName("free") }
17+
FreeCall() { this.getTarget().hasGlobalName("free") }
1818
}
1919

2020
from IfStmt stmt, FreeCall fc, Variable v

0 commit comments

Comments
 (0)