Comments (1)
> 1. Defect type: GCC_ANALYZER_WARNING
> 1. libdatrie-0.2.13/datrie/trie.c:1115:14: warning[-Wanalyzer-malloc-leak]: leak of 's'
> 41. libdatrie-0.2.13/datrie/trie.c:75:62: note: in definition of macro 'trie_da_get_tail_index'
> # 1113| *alpha_p++ = alpha_map_trie_to_char (s->trie->alpha_map, *tail_str++);
> # 1114| }
> # 1115|-> *alpha_p = 0;
> # 1116|
> # 1117| return alpha_key;
I can't see how 's
' can be leaked here, as no allocated memory is associated to it,
and it's just a read-only const pointer. Regarding the macro trie_get_tail_index()
,
it just expands to the harmless read-only da_get_base()
call.
> 2. Defect type: GCC_ANALYZER_WARNING
> 1. libdatrie-0.2.13/datrie/trie-string.c:64:8: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'p'
> # 62| *p++ = *str++;
> # 63| }
> # 64|-> *p = TRIE_CHAR_TERM;
> # 65|
> # 66| return dup;
This one is reasonable, as p
points to a block of malloc
-ed memory (dup
),
which can be NULL
upon malloc()
failure. Probably we should address it,
along with similar patterns in other places.
from libdatrie.
Related Issues (20)
- about default header files HOT 2
- Difficulties cross-compiling HOT 1
- Replace autotools with CMake
- Should we convert it to C++? HOT 1
- 支持英文匹配吗?
- Build errors? HOT 2
- Installation error -- possibly undefined macro AC_MSG_RESULT HOT 2
- undefined reference to `libiconv_close'
- Warning in test_walk.c
- build error: ld: error: undefined symbol: locale_charset (if configure detects locale_charset) HOT 2
- Any interest in deserializing from a memory buffer?
- Parallel test suite execution causes tests to fail
- error: possibly undefined macro: AC_MSG_RESULT
- fail tests in msys
- complexity for searching HOT 2
- Comparison of unsigned size_t with 0 creates unreachable code HOT 1
- Memory corruption error in "trie_new" method when using libdatrie v2.10.0 HOT 3
- Cannot install r0.2.10 on centos 7 HOT 2
- possible bug HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libdatrie.