From: Sebastian Harl Date: Mon, 16 Feb 2009 10:53:02 +0000 (+0100) Subject: perl plugin: Fixed a memory leak in pplugin_dispatch_notification(). X-Git-Tag: collectd-4.6.0~12 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0a4ce0ff7d08fccff1fe48d0e837ae1a0bf59220;p=collectd.git perl plugin: Fixed a memory leak in pplugin_dispatch_notification(). Free the notification meta information that have possibly been allocated in notification2hv(). --- diff --git a/src/perl.c b/src/perl.c index d7087d1f..efb8bdd6 100644 --- a/src/perl.c +++ b/src/perl.c @@ -914,6 +914,8 @@ static int pplugin_dispatch_notification (pTHX_ HV *notif) { notification_t n; + int ret; + if (NULL == notif) return -1; @@ -922,7 +924,9 @@ static int pplugin_dispatch_notification (pTHX_ HV *notif) if (0 != hv2notification (aTHX_ notif, &n)) return -1; - return plugin_dispatch_notification (&n); + ret = plugin_dispatch_notification (&n); + plugin_notification_meta_free (&n); + return ret; } /* static int pplugin_dispatch_notification (HV *) */ /*