Christian Brabandt wrote:

> > > On Wed, November 28, 2012 15:25, Bram Moolenaar wrote:
> > > >
> > > > Patch 7.3.730
> > > > Problem:    Crash in PHP file when using syntastic. (Ike Devolder)
> > > > Solution:   Avoid using NULL pointer. (Christian Brabandt)
> > > > Files:      src/quickfix.c
> > > 
> > > Huh, that was fast.
> > 
> > Trying to catch up with the long list of patches.
> > 
> > > I haven't gotten the time to check the valgrind
> > > question yet, that came up in that thread (I don't particular know
> > > valgrind very well) and additionally, we should remove the win_T
> > > argument to the call of qf_new_list() that was introduced with patch
> > > 7.3.715.
> > 
> > I can sort of see why setting w_llist to NULL can be removed.  But
> > checking with valgrind is still a good idea.  If you have some script
> > that will touch the relevant code.
> 
> Got some more memory leaks. Root cause is, qf_title can be NULL and will 
> be when using setloclist() and a like. So the memory leak prevents a 
> crash, which is good, but we are still leaking memory ;(
> 
> I know why it crashes, but I am not sure, what causes it. I think Vim 
> gets confused by the vimgrep and the setloclist() function both filling 
> the quickfix list and so somehow the qf_count gets invalid or does not 
> get reset correctly somewhere, so the following patch works around this 
> issue by making sure, we are only freeing valid qfline_T items.
> 
> The patch to prevent the crash and the memory leak is something like 
> this:

[...]

> Running Vim with this patch, prevents the syntastic crash and the 
> setloclist() crash on BufUnload and also it passes all tests and 
> valgrind did not complain about memory leaks anymore (at least not in 
> quickfix.c, but it still complains about a memory leakage in getpwuid())

That sounds good.  Since this is complicated it would be good to add a
few comments to give the reader a hint about what happens.

-- 
Where do you want to crash today?

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
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

Raspunde prin e-mail lui