Trying to fix segfault.
authorZsombor Nagy <zsombor@niif.hu>
Tue, 8 Nov 2011 15:07:32 +0000 (16:07 +0100)
committerZsombor Nagy <zsombor@niif.hu>
Tue, 8 Nov 2011 15:07:32 +0000 (16:07 +0100)
ext/arc_submit.cpp

index d2db0d3..34e0be0 100644 (file)
@@ -158,16 +158,15 @@ char* arc_submit(int argc, char **argv) {
   std::list<Arc::Job> submittedJobs;
   
   if (ChosenBroker->Submit(targen.GetExecutionTargets(), jobdesc, submittedJobs.back())) {
   std::list<Arc::Job> submittedJobs;
   
   if (ChosenBroker->Submit(targen.GetExecutionTargets(), jobdesc, submittedJobs.back())) {
-    logger.msg(Arc::DEBUG, "Job submitted with ID: %s", submittedJobs.back().JobID.str());
+    job_id = new_str(submittedJobs.back().JobID.str().c_str());
+    logger.msg(Arc::DEBUG, "Job submitted with ID: %s", job_id);
   } else {
     logger.msg(Arc::ERROR, "Job submission failed (ChosenBroker->Submit returned false)");
     submittedJobs.pop_back();
   }
   
   Arc::Job::WriteJobsToFile(usercfg.JobListFile(), submittedJobs);
   } else {
     logger.msg(Arc::ERROR, "Job submission failed (ChosenBroker->Submit returned false)");
     submittedJobs.pop_back();
   }
   
   Arc::Job::WriteJobsToFile(usercfg.JobListFile(), submittedJobs);
-  
-  job_id = new_str(submittedJobs.back().JobID.str().c_str());
-  
+    
   return job_id;
 }
 
   return job_id;
 }