Hi

Attached patch fixes a memory leak in regexp_nfa.c
detected by valgrind:

==3055== 128 bytes in 4 blocks are definitely lost in loss record 76 of 110
==3055==    at 0x4C2B3F8: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==3055==    by 0x50E98C: lalloc (misc2.c:929)
==3055==    by 0x572226: post2nfa (regexp_nfa.c:2161)
==3055==    by 0x57697F: nfa_regcomp (regexp_nfa.c:3682)
==3055==    by 0x576CF7: vim_regcomp (regexp.c:7827)
==3055==    by 0x5C6829: get_syn_pattern (syntax.c:5606)
==3055==    by 0x5C56E0: syn_cmd_region (syntax.c:5109)
==3055==    by 0x5C7CCB: ex_syntax (syntax.c:6218)
==3055==    by 0x49A0E6: do_one_cmd (ex_docmd.c:2686)
==3055==    by 0x49764B: do_cmdline (ex_docmd.c:1124)
==3055==    by 0x495318: do_source (ex_cmds2.c:3260)
==3055==    by 0x494516: source_callback (ex_cmds2.c:2687)
==3055==    by 0x494717: do_in_runtimepath (ex_cmds2.c:2781)
==3055==    by 0x494540: source_runtime (ex_cmds2.c:2701)
==3055==    by 0x4944EE: ex_runtime (ex_cmds2.c:2677)
==3055==    by 0x49A0E6: do_one_cmd (ex_docmd.c:2686)
==3055==    by 0x49764B: do_cmdline (ex_docmd.c:1124)
==3055==    by 0x47B484: ex_execute (eval.c:20914)
==3055==    by 0x49A0E6: do_one_cmd (ex_docmd.c:2686)
==3055==    by 0x49764B: do_cmdline (ex_docmd.c:1124)
==3055==    by 0x47F99D: call_user_func (eval.c:22651)
==3055==    by 0x467941: call_func (eval.c:8494)
==3055==    by 0x4674F6: get_func_tv (eval.c:8336)
==3055==    by 0x45FEC4: ex_call (eval.c:3459)
==3055==    by 0x49A0E6: do_one_cmd (ex_docmd.c:2686)
==3055==    by 0x49764B: do_cmdline (ex_docmd.c:1124)
==3055==    by 0x4C6547: apply_autocmds_group (fileio.c:9453)
==3055==    by 0x4C5D39: apply_autocmds (fileio.c:9032)
==3055==    by 0x5442A2: did_set_string_option (option.c:7067)
==3055==    by 0x53FD57: do_set (option.c:4872)
==3055==    by 0x4A8C5F: ex_set (ex_docmd.c:11349)
==3055==    by 0x49A0E6: do_one_cmd (ex_docmd.c:2686)
==3055==    by 0x49764B: do_cmdline (ex_docmd.c:1124)
==3055==    by 0x47B484: ex_execute (eval.c:20914)
==3055==    by 0x49A0E6: do_one_cmd (ex_docmd.c:2686)
==3055==    by 0x49764B: do_cmdline (ex_docmd.c:1124)
==3055==    by 0x4C6547: apply_autocmds_group (fileio.c:9453)
==3055==    by 0x4C5D39: apply_autocmds (fileio.c:9032)
==3055==    by 0x5442FC: did_set_string_option (option.c:7075)
==3055==    by 0x541274: set_string_option (option.c:5627)
==3055==    by 0x547673: set_option_value (option.c:8999)
==3055==    by 0x4A8BBA: ex_setfiletype (ex_docmd.c:11316)
==3055==    by 0x49A0E6: do_one_cmd (ex_docmd.c:2686)
==3055==    by 0x49764B: do_cmdline (ex_docmd.c:1124)
==3055==    by 0x47F99D: call_user_func (eval.c:22651)
==3055==    by 0x467941: call_func (eval.c:8494)
==3055==    by 0x4674F6: get_func_tv (eval.c:8336)
==3055==    by 0x45FEC4: ex_call (eval.c:3459)
==3055==    by 0x49A0E6: do_one_cmd (ex_docmd.c:2686)
==3055==    by 0x49764B: do_cmdline (ex_docmd.c:1124)

I can reproduce it with Vim-7.3.988 using...
   vim -N -c ':syntax on' vim/src/spell.c
... and then exiting immediately with ":q!"

Regards
Dominique

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Attachment: fix-leak-regex_nfa.c-7.3.988.patch
Description: Binary data

Raspunde prin e-mail lui