[MDEV-5173] Cppcheck report Created: 2013-10-20  Updated: 2014-03-28  Resolved: 2014-03-26

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.36, 10.0.9
Fix Version/s: 10.0.10

Type: Bug Priority: Major
Reporter: Julien Nabet Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None
Environment:

pc x86-64 Debian testing


Attachments: Text File clear_cppcheck_reports.txt    
Issue Links:
Duplicate
duplicates MDEV-5967 tautological compare in filesort_util... Closed

 Description   

Hello,

Cppcheck (a free C++ static analyzer) reported this on trunk bzr sources retrieved yesterday:

[extra/jemalloc/src/arena.c:2268] -> [extra/jemalloc/src/arena.c:2268]: (style) Same expression on both sides of '&&'.
[sql/filesort_utils.h:98] -> [sql/filesort_utils.h:98]: (style) Same expression on both sides of '=='.
[sql-common/client_authentication.cc:85] -> [sql-common/client_authentication.cc:85]: (style) Same expression on both sides of '&&'.

[extra/yassl/src/yassl_int.cpp:1103]: (performance) Prefer prefix ++/-- operators for non-primitive types.
[libmysqld/examples/builder-sample/emb_samples.cpp:199]: (performance) Prefer prefix ++/-- operators for non-primitive types.
[sql/item_cmpfunc.cc:6025]: (performance) Prefer prefix ++/-- operators for non-primitive types.
[sql/item_subselect.cc:1886]: (performance) Prefer prefix ++/-- operators for non-primitive types.
[sql/opt_subselect.cc:3699]: (performance) Prefer prefix ++/-- operators for non-primitive types.

[extra/jemalloc/test/thread_arena.c:80]: (error) Memory leak: p
[extra/yassl/examples/echoserver/echoserver.cpp:166]: (error) Resource leak: fout
[extra/yassl/src/ssl.cpp:794]: (error) Resource leak: dir
[sql/set_var.h:213]: (style) Class 'set_var' is unsafe, 'set_var::value' can leak by wrong usage.
[sql/sql_select.h:1594]: (style) Class 'store_key' is unsafe, 'store_key::to_field' can leak by wrong usage.
[mysys/ma_dyncol.c:1650]: (error) Memory leak: columns_order
[mysys/ma_dyncol.c:4036]: (error) Memory leak: str
[pcre/pcregrep.c:468]: (error) Memory leak: p
[sql/mysql_install_db.cc:662]: (error) Resource leak: in
[sql/sp.cc:2246]: (error) Memory leak: creation_ctx

[sql/handler.h:606]: (error) Buffer is accessed out of bounds: data

[mysys/ma_dyncol.c:3962] -> [mysys/ma_dyncol.c:3958]: (style) Duplicate conditions in 'if' and related 'else if'.

[cmd-line-utils/readline/bind.c:2087]: (style) Array index 'j' is used before limits check.

[sql/handler.h:606]: (error) Buffer is accessed out of bounds: data

and this kind:

[sql/sp_head.cc:596]: (warning) Ineffective call of function 'empty()'. Did you intend to call 'clear()' instead?

(I attached a file)

I let cppcheck run only about 600 files on a little less than 3000 because it's very long. If you're interested in these reports, I'll try a full run.

Julien



 Comments   
Comment by Georg Richter [ 2013-10-20 ]

This seems to be MariaDB server code, not the client library for c ?!

Comment by Julien Nabet [ 2013-10-20 ]

You're right I don't know if it's possible to reclassify the bug.

Comment by Rasmus Johansson (Inactive) [ 2013-10-23 ]

I moved this bug to the MariaDB server project.

Generated at Thu Feb 08 07:02:14 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.