smallbasic / SmallBASIC

SmallBASIC is a fast and easy to learn BASIC language interpreter ideal for everyday calculations, scripts and prototypes. SmallBASIC includes trigonometric, matrices and algebra functions, a built in IDE, a powerful string library, system, sound, and graphic commands along with structured programming syntax
https://smallbasic.github.io
GNU General Public License v3.0
209 stars 37 forks source link

JOIN memory leak #47

Closed chrisws closed 8 years ago

chrisws commented 8 years ago

==3182== Invalid write of size 1 ==3182== at 0x4C30C30: strcat (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==3182== by 0x45DDF9: cmd_wjoin (blib.c:2242) ==3182== by 0x46F111: bc_loop_call_proc (brun.c:540) ==3182== by 0x46FB91: bc_loop (brun.c:929) ==3182== by 0x471613: sbasic_exec_task (brun.c:1525) ==3182== by 0x471739: sbasic_recursive_exec (brun.c:1562) ==3182== by 0x471E9E: sbasic_exec (brun.c:1770) ==3182== by 0x471F35: sbasicmain (brun.c:1808) ==3182== by 0x42C664: System::execute(char const) (system.cpp:129) ==3182== by 0x42D9FD: System::runEdit(char const_) (system.cpp:553) ==3182== by 0x445B09: Runtime::runShell(char const*, int, int) (runtime.cpp:292) ==3182== by 0x4442F3: main (main.cpp:366) ==3182== Address 0xfcd8df0 is 0 bytes after a block of size 256 alloc'd ==3182== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==3182== by 0x45DCD6: cmd_wjoin (blib.c:2225)

Bug needs a particular set of pre-conditions to be revealed, see: http://smallbasic.sourceforge.net/?q=node/1586

chrisws commented 8 years ago

Fixed