From: Jiří Filipovič Date: Tue, 3 Jun 2008 11:48:06 +0000 (+0000) Subject: Memory leak fixed. X-Git-Tag: glite-yaim-lb_R_4_0_3_1~18 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=3b87830ade211bf9528d568840239def6ead55de;p=jra1mw.git Memory leak fixed. --- 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; }