nuclei icon indicating copy to clipboard operation
nuclei copied to clipboard

memleaks and null

Open ferdymercury opened this issue 4 months ago • 0 comments

QtCreator (clang-tidy) reports 2 memleaks and 1 null access:

/home/user/nuclei/source/ENSDFDataSource.cpp:240:25: warning: Potential leak of memory pointed to by 'd' [clang-analyzer-cplusplus.NewDeleteLeaks]
 1: Assuming the condition is false in /home/user/nuclei/source/ENSDFDataSource.cpp:23
 2: Taking false branch in /home/user/nuclei/source/ENSDFDataSource.cpp:23
 3: Assuming the condition is false in /home/user/nuclei/source/ENSDFDataSource.cpp:28
 4: Taking false branch in /home/user/nuclei/source/ENSDFDataSource.cpp:28
 5: Assuming the condition is false in /home/user/nuclei/source/ENSDFDataSource.cpp:33
 6: Taking false branch in /home/user/nuclei/source/ENSDFDataSource.cpp:33
 7: Taking true branch in /home/user/nuclei/source/ENSDFDataSource.cpp:41
 8: Calling 'ENSDFDataSource::createENSDFCache' in /home/user/nuclei/source/ENSDFDataSource.cpp:42
 9: Assuming the condition is false in /home/user/nuclei/source/ENSDFDataSource.cpp:194
10: Taking false branch in /home/user/nuclei/source/ENSDFDataSource.cpp:194
11: Taking false branch in /home/user/nuclei/source/ENSDFDataSource.cpp:199
12: Assuming the condition is false in /home/user/nuclei/source/ENSDFDataSource.cpp:204
13: Taking false branch in /home/user/nuclei/source/ENSDFDataSource.cpp:204
14: Assuming the condition is false in /home/user/nuclei/source/ENSDFDataSource.cpp:207
15: Loop condition is false. Execution jumps to the end of the function in /home/user/nuclei/source/ENSDFDataSource.cpp:207
16: Memory is allocated in /home/user/nuclei/source/ENSDFDataSource.cpp:243
17: Potential leak of memory pointed to by 'd' in /home/user/nuclei/source/ENSDFDataSource.cpp:240
/home/user/nuclei/source/ENSDFDataSource.cpp:259:5: warning: Potential leak of memory pointed to by 'aa' [clang-analyzer-cplusplus.NewDeleteLeaks]
 1: Assuming the condition is false in /home/user/nuclei/source/ENSDFDataSource.cpp:23
 2: Taking false branch in /home/user/nuclei/source/ENSDFDataSource.cpp:23
 3: Assuming the condition is false in /home/user/nuclei/source/ENSDFDataSource.cpp:28
 4: Taking false branch in /home/user/nuclei/source/ENSDFDataSource.cpp:28
 5: Assuming the condition is false in /home/user/nuclei/source/ENSDFDataSource.cpp:33
 6: Taking false branch in /home/user/nuclei/source/ENSDFDataSource.cpp:33
 7: Taking true branch in /home/user/nuclei/source/ENSDFDataSource.cpp:41
 8: Calling 'ENSDFDataSource::createENSDFCache' in /home/user/nuclei/source/ENSDFDataSource.cpp:42
 9: Assuming the condition is false in /home/user/nuclei/source/ENSDFDataSource.cpp:194
10: Taking false branch in /home/user/nuclei/source/ENSDFDataSource.cpp:194
11: Taking false branch in /home/user/nuclei/source/ENSDFDataSource.cpp:199
12: Assuming the condition is false in /home/user/nuclei/source/ENSDFDataSource.cpp:204
13: Taking false branch in /home/user/nuclei/source/ENSDFDataSource.cpp:204
14: Assuming the condition is false in /home/user/nuclei/source/ENSDFDataSource.cpp:207
15: Loop condition is false. Execution jumps to the end of the function in /home/user/nuclei/source/ENSDFDataSource.cpp:207
16: Memory is allocated in /home/user/nuclei/source/ENSDFDataSource.cpp:232
17: Potential leak of memory pointed to by 'aa' in /home/user/nuclei/source/ENSDFDataSource.cpp:259
/home/user/nuclei/source/SchemeEditor/LevelItem.cpp:297:5: warning: Called C++ object pointer is null [clang-analyzer-core.CallAndMessage]
 1: Assuming 'parentpos' is not equal to NoParent in /home/user/nuclei/source/SchemeEditor/LevelItem.cpp:287
 2: Taking true branch in /home/user/nuclei/source/SchemeEditor/LevelItem.cpp:287
 3: Assuming 'parentpos' is equal to RightParent in /home/user/nuclei/source/SchemeEditor/LevelItem.cpp:290
 4: Left side of '&&' is true in /home/user/nuclei/source/SchemeEditor/LevelItem.cpp:290
 5: Assuming field 'hltext_' is null in /home/user/nuclei/source/SchemeEditor/LevelItem.cpp:290
 6: Assuming pointer value is null in /home/user/nuclei/source/SchemeEditor/LevelItem.cpp:290
 7: Taking false branch in /home/user/nuclei/source/SchemeEditor/LevelItem.cpp:290
 8: 'parentpos' is not equal to NoParent in /home/user/nuclei/source/SchemeEditor/LevelItem.cpp:296
 9: Taking true branch in /home/user/nuclei/source/SchemeEditor/LevelItem.cpp:296
10: Called C++ object pointer is null in /home/user/nuclei/source/SchemeEditor/LevelItem.cpp:297
/usr/include/boost/algorithm/string/detail/classification.hpp:135:25: warning: Potential memory leak [clang-analyzer-cplusplus.NewDeleteLeaks]
 1: Assuming the condition is false in /home/user/nuclei/source/ensdf/records/History.cpp:15
 2: Taking false branch in /home/user/nuclei/source/ensdf/records/History.cpp:15
 3: Assuming the condition is false in /home/user/nuclei/source/ensdf/records/History.cpp:21
 4: Left side of '&&' is false in /home/user/nuclei/source/ensdf/records/History.cpp:21
 5: Loop condition is false. Execution continues on line 24 in /home/user/nuclei/source/ensdf/records/History.cpp:21
 6: Assuming the condition is false in /home/user/nuclei/source/ensdf/records/History.cpp:31
 7: Taking false branch in /home/user/nuclei/source/ensdf/records/History.cpp:31
 8: Assuming the condition is false in /home/user/nuclei/source/ensdf/records/History.cpp:31
 9: Taking false branch in /home/user/nuclei/source/ensdf/records/History.cpp:31
10: Calling 'split<std::vector<std::basic_string<char>>, std::basic_string<char> &, boost::algorithm::detail::is_any_ofF<char>>' in /home/user/nuclei/source/ensdf/records/History.cpp:30
11: Calling 'token_finder<boost::algorithm::detail::is_any_ofF<char>>' in /usr/include/boost/algorithm/string/split.hpp:161
12: Calling constructor for 'token_finderF<boost::algorithm::detail::is_any_ofF<char>>' in /usr/include/boost/algorithm/string/finder.hpp:219
13: Calling copy constructor for 'is_any_ofF<char>' in /usr/include/boost/algorithm/string/detail/finder.hpp:554
14: Taking false branch in /usr/include/boost/algorithm/string/detail/classification.hpp:114
15: Memory is allocated in /usr/include/boost/algorithm/string/detail/classification.hpp:123
16: Returning from copy constructor for 'is_any_ofF<char>' in /usr/include/boost/algorithm/string/detail/finder.hpp:554
17: Returning from constructor for 'token_finderF<boost::algorithm::detail::is_any_ofF<char>>' in /usr/include/boost/algorithm/string/finder.hpp:219
18: Returned allocated memory in /usr/include/boost/algorithm/string/split.hpp:161
19: Calling '~is_any_ofF' in /usr/include/boost/algorithm/string/split.hpp:161
20: Potential memory leak in /usr/include/boost/algorithm/string/detail/classification.hpp:135
/usr/include/boost/algorithm/string/detail/classification.hpp:135:25: warning: Potential memory leak [clang-analyzer-cplusplus.NewDeleteLeaks]
 1: Calling 'split<std::vector<std::basic_string<char>>, std::basic_string<char> &, boost::algorithm::detail::is_any_ofF<char>>' in /home/user/nuclei/source/qpx_util.h:76
 2: Calling 'token_finder<boost::algorithm::detail::is_any_ofF<char>>' in /usr/include/boost/algorithm/string/split.hpp:161
 3: Calling constructor for 'token_finderF<boost::algorithm::detail::is_any_ofF<char>>' in /usr/include/boost/algorithm/string/finder.hpp:219
 4: Calling copy constructor for 'is_any_ofF<char>' in /usr/include/boost/algorithm/string/detail/finder.hpp:554
 5: Taking false branch in /usr/include/boost/algorithm/string/detail/classification.hpp:114
 6: Memory is allocated in /usr/include/boost/algorithm/string/detail/classification.hpp:123
 7: Returning from copy constructor for 'is_any_ofF<char>' in /usr/include/boost/algorithm/string/detail/finder.hpp:554
 8: Returning from constructor for 'token_finderF<boost::algorithm::detail::is_any_ofF<char>>' in /usr/include/boost/algorithm/string/finder.hpp:219
 9: Returned allocated memory in /usr/include/boost/algorithm/string/split.hpp:161
10: Calling '~is_any_ofF' in /usr/include/boost/algorithm/string/split.hpp:161
11: Potential memory leak in /usr/include/boost/algorithm/string/detail/classification.hpp:135
/usr/include/boost/algorithm/string/detail/classification.hpp:139:17: warning: Potential memory leak [clang-analyzer-cplusplus.NewDeleteLeaks]
 1: Calling 'split<std::vector<std::basic_string<char>>, const std::basic_string<char> &, boost::algorithm::detail::is_any_ofF<char>>' in /home/user/nuclei/source/ensdf/records/Continuation.cpp:204
 2: Calling 'token_finder<boost::algorithm::detail::is_any_ofF<char>>' in /usr/include/boost/algorithm/string/split.hpp:161
 3: Calling copy constructor for 'is_any_ofF<char>' in /usr/include/boost/algorithm/string/finder.hpp:219
 4: Taking false branch in /usr/include/boost/algorithm/string/detail/classification.hpp:114
 5: Memory is allocated in /usr/include/boost/algorithm/string/detail/classification.hpp:123
 6: Returning from copy constructor for 'is_any_ofF<char>' in /usr/include/boost/algorithm/string/finder.hpp:219
 7: Calling '~is_any_ofF' in /usr/include/boost/algorithm/string/finder.hpp:219
 8: Left side of '&&' is false in /usr/include/boost/algorithm/string/detail/classification.hpp:135
 9: Potential memory leak in /usr/include/boost/algorithm/string/detail/classification.hpp:139
/usr/include/boost/algorithm/string/detail/classification.hpp:139:17: warning: Potential memory leak [clang-analyzer-cplusplus.NewDeleteLeaks]
 1: Assuming the condition is false in /home/user/nuclei/source/ensdf/records/History.cpp:15
 2: Taking false branch in /home/user/nuclei/source/ensdf/records/History.cpp:15
 3: Assuming the condition is false in /home/user/nuclei/source/ensdf/records/History.cpp:21
 4: Left side of '&&' is false in /home/user/nuclei/source/ensdf/records/History.cpp:21
 5: Loop condition is false. Execution continues on line 24 in /home/user/nuclei/source/ensdf/records/History.cpp:21
 6: Calling 'split<std::vector<std::basic_string<char>>, std::basic_string<char> &, boost::algorithm::detail::is_any_ofF<char>>' in /home/user/nuclei/source/ensdf/records/History.cpp:25
 7: Calling 'token_finder<boost::algorithm::detail::is_any_ofF<char>>' in /usr/include/boost/algorithm/string/split.hpp:161
 8: Calling copy constructor for 'is_any_ofF<char>' in /usr/include/boost/algorithm/string/finder.hpp:219
 9: Taking false branch in /usr/include/boost/algorithm/string/detail/classification.hpp:114
10: Memory is allocated in /usr/include/boost/algorithm/string/detail/classification.hpp:123
11: Returning from copy constructor for 'is_any_ofF<char>' in /usr/include/boost/algorithm/string/finder.hpp:219
12: Calling '~is_any_ofF' in /usr/include/boost/algorithm/string/finder.hpp:219
13: Left side of '&&' is false in /usr/include/boost/algorithm/string/detail/classification.hpp:135
14: Potential memory leak in /usr/include/boost/algorithm/string/detail/classification.hpp:139
/usr/include/boost/algorithm/string/detail/classification.hpp:139:17: warning: Potential memory leak [clang-analyzer-cplusplus.NewDeleteLeaks]
 1: Calling 'trim_if<std::basic_string<char>, boost::algorithm::detail::is_any_ofF<char>>' in /home/user/nuclei/source/qpx_util.h:74
 2: Calling 'trim_right_if<std::basic_string<char>, boost::algorithm::detail::is_any_ofF<char>>' in /usr/include/boost/algorithm/string/trim.hpp:360
 3: Calling copy constructor for 'is_any_ofF<char>' in /usr/include/boost/algorithm/string/trim.hpp:240
 4: Taking false branch in /usr/include/boost/algorithm/string/detail/classification.hpp:114
 5: Memory is allocated in /usr/include/boost/algorithm/string/detail/classification.hpp:123
 6: Returning from copy constructor for 'is_any_ofF<char>' in /usr/include/boost/algorithm/string/trim.hpp:240
 7: Calling '~is_any_ofF' in /usr/include/boost/algorithm/string/trim.hpp:240
 8: Left side of '&&' is false in /usr/include/boost/algorithm/string/detail/classification.hpp:135
 9: Potential memory leak in /usr/include/boost/algorithm/string/detail/classification.hpp:139
/home/user/nuclei/source/ENSDFDataSource.cpp
/home/user/nuclei/source/SchemeEditor/LevelItem.cpp
/usr/include/boost/algorithm/string/detail/classification.hpp

ferdymercury avatar Feb 15 '24 08:02 ferdymercury