From 3b87830ade211bf9528d568840239def6ead55de Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ji=C5=99=C3=AD=20Filipovi=C4=8D?= Date: Tue, 3 Jun 2008 11:48:06 +0000 Subject: [PATCH] Memory leak fixed. --- org.glite.jp.primary/src/attrs.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/org.glite.jp.primary/src/attrs.c b/org.glite.jp.primary/src/attrs.c index bea33c7..d5d81fb 100644 --- a/org.glite.jp.primary/src/attrs.c +++ b/org.glite.jp.primary/src/attrs.c @@ -222,8 +222,14 @@ int glite_jpps_get_attrs(glite_jp_context_t ctx,const char *job,char **attr,int , known_namespaces[i].plugin_handles[j]); printf("closing plugin %i at class %s, file %s\n", known_namespaces[i].plugin_handles[j], known_namespaces[i].opened_classes[j], known_namespaces[i].opened_files[j]); glite_jppsbe_close_file(ctx, known_namespaces[i].file_handles[j]); - known_namespaces[i].opened_classes[j] = NULL; - known_namespaces[i].opened_files[j] = NULL; + if (known_namespaces[i].opened_classes[j]){ + free(known_namespaces[i].opened_classes[j]); + known_namespaces[i].opened_classes[j] = NULL; + } + if (known_namespaces[i].opened_files[j]){ + free(known_namespaces[i].opened_files[j]); + known_namespaces[i].opened_files[j] = NULL; + } known_namespaces[i].plugin_handles[j] = NULL; known_namespaces[i].file_handles[j] = NULL; } -- 1.8.2.3