Fixed bug that damaged memory consistency.
authorJiří Filipovič <fila@ics.muni.cz>
Tue, 3 Apr 2007 12:39:13 +0000 (12:39 +0000)
committerJiří Filipovič <fila@ics.muni.cz>
Tue, 3 Apr 2007 12:39:13 +0000 (12:39 +0000)
org.glite.jp.primary/src/attrs.c
org.glite.jp.primary/src/new_ftp_backend.c

index c8a24e2..89d4e16 100644 (file)
@@ -75,10 +75,12 @@ static int merge_attrvals(glite_jp_attrval_t **out,int nout,const glite_jp_attrv
 void process_files(glite_jp_context_t ctx, const char *job, glite_jp_attrval_t** out, int* nout, const char* attr, const glite_jpps_fplug_data_t* plugin, const char* class, const char* uri){
        void *ph, *beh; 
        char** names = NULL;
-        int nnames = glite_jppsbe_get_names(ctx, job, class, &names);
+        int nnames;
        int n;
        glite_jp_error_t        *keep_err = NULL;
 
+       nnames = glite_jppsbe_get_names(ctx, job, class, &names);
+
         for (n = 0; n < nnames; n++)
                if (! glite_jppsbe_open_file(ctx,job,class, names[n], O_RDONLY, &beh)) {
                        if (!plugin->ops.open(plugin->fpctx,beh,uri,&ph)) {
index 88b26d4..8dd5421 100644 (file)
@@ -2400,6 +2400,7 @@ int glite_jppsbe_read_tag(
                 err.desc = "cannot read tag";
                glite_jp_stack_error(ctx,&err);         
                e = ctx->error;
+               ctx->error = NULL;
                glite_jppsbe_close_file(ctx,h->bhandle);
                ctx->error = e;
                return err.code;