Fix memory leak on notifications.c and xodtemplate.c

Andreas Ericsson ae at op5.se
Mon Nov 21 17:20:33 CET 2011


On 10/11/2011 03:51 PM, Dorian Guillois wrote:
> On Mon, Oct 10, 2011 at 9:31 PM, Andreas Ericsson<ae at op5.se>  wrote:
>> Try this with multiple contacts getting notified, using a notification
>> command that uses all macros. Some macros will be missing for all
>> contacts beyond the first one if I'm reading the code right.
> 
> I'm sorry, but i don't understand. I cleanup nagios_macros at the end of the
> function when nothing uses this variable anymore. Moreover the loop that sends
> notifications is over. So i don't understand why some macros would be missing.
> I made some basic testing, and i think it works correctly.
> 

I've done some more extensive testing with this patch, and I can say
with 100% certainty that it doesn't work. With more than two contacts
and multiple notifications being sent frequently the patch results in
a coredump. I have no idea why, but a different version, clearing only
set macros, has been applied instead.

One thing worth noting though, is that when I or any other gatekeeper
for patches say "I doubt this works, so you need to fix this or that",
a bit more reassurance than "I did some basic testing and it seems ok"
is not only recommended, but actually required. Sending in crap (which
this was) just means I'll need more verification that future patches
from you work the way you say they should. If that happens, I suggest
you send me details regarding the tests you've done and help me set
them up myself (which should be easy if you really *do* run more than
just basic tests) so I can really verify that the patch does what it's
supposed to.

On a kindlier note; Thanks for spotting the problem.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d




More information about the Developers mailing list