From 4c8dc8ef46b360f4586e21a81cc2cd6037deb34f Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Mon, 26 Nov 2007 12:17:26 +0100 Subject: [PATCH] perl plugin: Fixed a memory leak in pplugin_register_data_set(). The data set definition is copied by plugin_register_data_set() (in plugin.c) and thus should be freed after it has been passed on to the plugin module. Signed-off-by: Sebastian Harl Signed-off-by: Florian Forster --- src/perl.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/perl.c b/src/perl.c index c0e99f5f..dc548b25 100644 --- a/src/perl.c +++ b/src/perl.c @@ -388,6 +388,7 @@ static char *get_module_name (char *buf, size_t buf_len, const char *module) { static int pplugin_register_data_set (pTHX_ char *name, AV *dataset) { int len = -1; + int ret = 0; int i = 0; data_source_t *ds = NULL; @@ -428,7 +429,12 @@ static int pplugin_register_data_set (pTHX_ char *name, AV *dataset) set->ds_num = len + 1; set->ds = ds; - return plugin_register_data_set (set); + + ret = plugin_register_data_set (set); + + free (ds); + free (set); + return ret; } /* static int pplugin_register_data_set (char *, SV *) */ /* -- 2.30.2