Yegappan wrote:

> On Fri, Nov 6, 2020 at 1:01 PM Bram Moolenaar <[email protected]>
> wrote:
> 
> > Thanks for looking into this. Obviously avoiding memory access errors is
> > important. That some memory is release only later (perhaps much later) is
> > less important.
> > if you know how to fix it that is welcome, but only if there is no risk of
> > breaking something else.
> >
> > Hmm, perhaps it should be:
> > #define NETBEANS_OPEN ((nb_channel) != NULL &&
> > channel_can_write_to(nb_channel))
> > No, channel_can_write_to() checks for the NULL pointer, thus that's not
> > needed.
> >
> > Or were you referring to what happens in netbeans_file_killed() ?
> >
> >
> > Yes. I am referring to the netbeans_file_killed() function. If the netbeans
> connection is not open, then this function will not cleanup the buffer
> reference. Later when the netbeans connection is closed using nbclose,
> it will try to access the dangling buffer pointer.
> 
> We can modify this function to always cleanup the buffer reference even
> if the netbeans connection is closed.

So that we then only need to check for NULL?  That would rely on always
calling netbeans_file_killed() when a buffer is deleted.  Perhaps that
is true already.

I notice the "bufp" is cleared, but no memory is freed.  "displayname"
and "signmap" could probably be cleared, and signmaplen set to zero.

-- 
hundred-and-one symptoms of being an internet addict:
210. When you get a divorce, you don't care about who gets the children,
     but discuss endlessly who can use the email address.

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

--- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202011071211.0A7CB3Fx674754%40masaka.moolenaar.net.

Raspunde prin e-mail lui