Re: [Nagios-devel] Fix memory leak on notifications.c and

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] Fix memory leak on notifications.c and

Post by Guest »

On 10/10/2011 02:21 PM, Dorian Guillois wrote:
> Hi,
>
> I found another memory leak in service_notification and
> host_notification functions into notifications.c and


This breaks things though. If all volatile macros are free()'d and
there's more than one contact to notify, the rest of the contacts
won't get all the macros they actually need (such as hostname,
service description and things like that). That's why we don't call
clear_volatile_macros_r() from there in the first place.

Since I'm guessing you've run this through valgrind, it should be
fairly easy to locate the spot where the leak happens and thus fix
it properly by just releasing the leaked memory.

> xodtemplate_read_config_data function into xodtemplate.c.
>

This one looks good though, even though it's a one-time leak in a
very rarely used codepath. I doubt anyone would stumble across it in
a normal setup, but good catch all the same.

--
Andreas Ericsson [email protected]
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.





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked