Sexpr tests leaking memory

Bug #1830209 reported by John Beard
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Committed
Low
John Beard

Bug Description

The Sexpr test leak memory:

==13786== 56 bytes in 1 blocks are definitely lost in loss record 129 of 244
==13786== at 0x4838DEF: operator new(unsigned long) (vg_replace_malloc.c:334)
==13786== by 0x12BD6E: SEXPR::PARSER::parseString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, __gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&) (sexpr_parser.cpp:93)
==13786== by 0x12B98D: SEXPR::PARSER::Parse(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (sexpr_parser.cpp:46)
==13786== by 0x125922: TEST_SEXPR_PARSER_FIXTURE::Parse(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (test_sexpr_parser.cpp:44)
==13786== by 0x121E86: SexprParser::ParseExceptions::test_method() (test_sexpr_parser.cpp:141)
==13786== by 0x12176D: SexprParser::ParseExceptions_invoker() (test_sexpr_parser.cpp:108)

This is because the SEXPR::PARSER class new's pointers and doesn't delete them on a parse failure (when an exception is thrown).

----

Found in master: 5.1.0-669-g83e08c927

Tags: cleanup qa
tags: added: qa
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision a045642b7ec87cd9fe55438cf55a6bc2286ee119
https://git.launchpad.net/kicad/patch/?id=a045642b7ec87cd9fe55438cf55a6bc2286ee119

Changed in kicad:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.