char *destination;
char *ce_node;
char *jdl;
+ /*!! if adding new field, modify also free_branch_state() */
} branch_state;
struct timeval last_pbs_event_timestamp;
int pbs_reruning; // true if rerun event arrived
+
+ /*!! if adding new field, modify also destroy_intJobStat_extension() */
} intJobStat;
typedef enum _edg_wll_PBSEventSource {
void destroy_intJobStat_extension(intJobStat *p)
{
- free(p->last_seqcode); p->last_seqcode = NULL;
- free(p->last_cancel_seqcode); p->last_cancel_seqcode = NULL;
- p->resubmit_type = EDG_WLL_RESUBMISSION_UNDEFINED;
+ if (p->last_seqcode) free(p->last_seqcode);
+ if (p->last_cancel_seqcode) free(p->last_cancel_seqcode);
+ if (p->branch_tag_seqcode) free(p->branch_tag_seqcode);
+ if (p->last_branch_seqcode) free(p->last_branch_seqcode);
+ if (p->deep_resubmit_seqcode) free(p->deep_resubmit_seqcode);
+ free_branch_state(&p->branch_states);
+ memset(p,0,sizeof(*p));
}
void destroy_intJobStat(intJobStat *p)
}
memset(&stat,0,sizeof stat);
- if (edg_wll_JobStatus(ctx,job,0,&stat)) goto abort; /* XXX: memory leak */
+ if (edg_wll_JobStatus(ctx,job,0,&stat)) {
+ edg_wll_FreeStatus(&stat);
+ goto abort;
+ }
switch (stat.state) {
case EDG_WLL_JOB_CLEARED:
if (now-stat.lastUpdateTime.tv_sec > timeout[i] && !check_strict_jobid(ctx,job))
{
- if (purge_one(ctx,job,dumpfile,request->flags&EDG_WLL_PURGE_REALLY_PURGE))
+ if (purge_one(ctx,job,dumpfile,request->flags&EDG_WLL_PURGE_REALLY_PURGE)) {
+ edg_wll_FreeStatus(&stat);
goto abort;
+ }
/* XXX: change with the streaming interface */
if (request->flags & EDG_WLL_PURGE_LIST_JOBS) {
asprintf(&response, "HTTP/1.1 %d %s", ret, edg_wll_HTTPErrorMessage(ret));
edg_wll_http_send(ctx, response, resp_headers, message,ctx->connections->serverConnection);
+ if (response) free(response);
+ if (message) free(message);
return edg_wll_Error(ctx,NULL,NULL);
}