Hi

Valgrind memory checker detects the following memory leak in Vim-7.2.148:

==26113== 36 bytes in 1 blocks are definitely lost in loss record 23 of 41
==26113==    at 0x402603E: malloc (vg_replace_malloc.c:207)
==26113==    by 0x8113A62: lalloc (misc2.c:866)
==26113==    by 0x8158375: vim_regcomp (regexp.c:1021)
==26113==    by 0x808CE03: ex_function (eval.c:19765)
==26113==    by 0x80A6807: do_one_cmd (ex_docmd.c:2622)
==26113==    by 0x80A4087: do_cmdline (ex_docmd.c:1096)
==26113==    by 0x8129E72: nv_colon (normal.c:5218)
==26113==    by 0x81234D6: normal_cmd (normal.c:1189)
==26113==    by 0x80E6655: main_loop (main.c:1180)
==26113==    by 0x80E61A2: main (main.c:939)

Leak happens whenever typing Ex command :fu[nction] /{pattern}
which lists function names matching {pattern}.

For example, this will cause a memory leak:

  $ vim -u NONE

  :function! Foo
  :endfunction

  :function /F

Attached patch fixes it.

-- Dominique

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Index: eval.c
===================================================================
RCS file: /cvsroot/vim/vim7/src/eval.c,v
retrieving revision 1.280
diff -c -r1.280 eval.c
*** eval.c	4 Feb 2009 15:27:06 -0000	1.280
--- eval.c	18 Apr 2009 07:30:06 -0000
***************
*** 19780,19785 ****
--- 19780,19786 ----
  			    list_func_head(fp, FALSE);
  		    }
  		}
+ 		vim_free(regmatch.regprog);
  	    }
  	}
  	if (*p == '/')

Raspunde prin e-mail lui