Re: [Vimprobable-users] [PATCH] Possible fix for crash on :echo
Vimprobable is a lean web browser optimised for full keyboard control
Brought to you by:
hanness
From: Daniel C. <dan...@gm...> - 2011-09-16 14:45:51
|
Hi! On Fri, Sep 16, 2011 at 03:59:03PM +0200, Hannes Schüller wrote: > The reason, and feel free to correct me, was roughly "we cannot be > bothered to track down all calling instances and free the memory there, > so let's just do it in this central function". Which lead to all kinds > of nasty race conditions in several less used functions. > > In your original patch, what I'd suggest to to allocate the memory, > call the function and then free the memory again afterwards. Nice and > readable. If we want to be sure, a "safefree" macro as suggested > certainly will not hurt. If I understood right, follwing patch should do that. It's a replacement for previous patch. We need to remove the const Arg from sript function to write the pointer ti NULL after freeing it. Daniel |