Build fix.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Mon, 9 Jun 2008 18:06:14 +0000 (18:06 +0000)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Mon, 9 Jun 2008 18:06:14 +0000 (18:06 +0000)
Segfault fix on error from multitags.

org.glite.jp.primary/src/soap_ops.c
org.glite.lb.state-machine/src/lb_plugin.c

index aaa5ba3..4a3ebdb 100644 (file)
@@ -307,11 +307,13 @@ SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__RecordMultiTags(
        glite_jpps_match_attr_multi(ctx,(const char **) jobs,(const glite_jp_attrval_t **) attrs);
 
 cleanup:
-       for (i=0; attrs[i]; i++) {
-               for (j=0; attrs[i][j].name; j++) glite_jp_attrval_free(&attrs[i][j],0);
-               free(attrs[i]);
+       if (attrs) {
+               for (i=0; attrs[i]; i++) {
+                       for (j=0; attrs[i][j].name; j++) glite_jp_attrval_free(&attrs[i][j],0);
+                       free(attrs[i]);
+               }
+               free(attrs);
        }
-       free(attrs);
        free(jobs);
 
        glite_jp_attrval_free(meta,0);
index 2197d41..6d980b8 100644 (file)
@@ -1576,7 +1576,7 @@ static int lb_filecom(void *fpctx, void *handle){
                                attr[0].timestamp = time(NULL);
                                attr[0].origin_detail = NULL;   /* XXX */
                                attr[1].name = NULL;
-                               glite_jppsbe_append_tag(ctx, edg_wlc_JobIdUnparse(h->status.jobId), attr);
+                               glite_jppsbe_append_tags(ctx, edg_wlc_JobIdUnparse(h->status.jobId), attr);
                         }
                         i++;
                 }