4 ms·
An example to detect use-after-free: https://godbolt.org/z/zhiNLW https://godbolt.org/z/zhiNLW Basically this replicates what clang-tidy did
by htfy96 6y ago
An example to detect use-after-free: https://godbolt.org/z/zhiNLW https://godbolt.org/z/zhiNLW
Basically this replicates what clang-tidy did
- cornstalks 6y agoToo bad it doesn't detect the mismatch between new and free.
- peapicker 6y agoAnd if you fix it to use delete instead of free, you get "can't delete void *" errors. Perhaps not the best example code.