Fix memory leak on notifications.c and xodtemplate.c

Dorian Guillois dguillois at merethis.com
Mon Oct 10 17:37:31 CEST 2011


On Mon, Oct 10, 2011 at 3:02 PM, Andreas Ericsson <ae at op5.se> wrote:
> 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.
>

In service_notification() we call
create_notification_list_from_service() who allocate
mac->x[MACRO_NOTIFICATIONISESCALATED] but it is impossible to release it with
free_notification_list(). So I propose to call
clear_volatile_macros_r() at the end of
service_notification().

What do you think about it ?

It is the same thing for host_notification().

-- 
Dorian GUILLOIS | Développeur

dguillois at merethis.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: leak_notifications.patch
Type: text/x-diff
Size: 2721 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20111010/abaca1a3/attachment.patch>
-------------- next part --------------
------------------------------------------------------------------------------
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. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list