#include <unistd.h>
#include "glite/lb/context-int.h"
+#include "glite/lb/connpool.h"
#ifdef BUILDING_LB_CLIENT
#include "consumer.h"
#else
dgerr(ctx,"edg_wll_JobStatus"); result = 1;
} else {
printstat_oneline(status,0);
+ edg_wll_FreeStatus(&status);
break;
}
sleep(3);
}
if (job) edg_wlc_JobIdFree(job);
-// if (status.state) edg_wll_FreeStatus(&status);
cleanup:
}
free(threads);
+ edg_wll_poolFree(); // for hunting memleaks
return 0;
}
}
else if ( !ctx->srvName || !ctx->srvPort )
{
+ if (found) free(srvName);
if (!ctx->p_query_server)
return(edg_wll_SetError(ctx, (edg_wll_ErrorCode) EINVAL, "Hostname of server to query is not set"));
else ctx->srvName = strdup(ctx->p_query_server);
free(errorMessage);
} else if (XMLCtx.errtxt) edg_wll_SetError(ctx, EDG_WLL_ERROR_XML_PARSE, XMLCtx.errtxt);
- if ((errorCode = edg_wll_Error(ctx,NULL,NULL))) {
+ if (!(errorCode = edg_wll_Error(ctx,NULL,NULL))) {
+ if (XMLCtx.errDesc || XMLCtx.errCode) {
+ ctx->errDesc = strdup(XMLCtx.errDesc);
+ ctx->errCode = XMLCtx.errCode;
+ errorCode = XMLCtx.errCode;
+ }
+ }
+ if (errorCode) {
for (i=0; i<XMLCtx.position; i++) edg_wlc_JobIdFree( (XMLCtx.jobsOutGlobal)[i] );
free(XMLCtx.jobsOutGlobal);
XMLCtx.jobsOutGlobal = NULL;
XMLCtx.errDesc = NULL;
XMLCtx.errCode = 0;
}
+
+ goto end;
}
/* malloc-ate one more row for NULL list termination */
XMLCtx.jobStatGlobal = NULL;
}
- if (XMLCtx.errDesc || XMLCtx.errCode) {
- ctx->errDesc = XMLCtx.errDesc;
- ctx->errCode = XMLCtx.errCode;
- errorCode = XMLCtx.errCode;
- }
-
+end:
/* print all warning if corresponding env variable is set */
if (XMLCtx.warntxt && getenv("EDG_WLL_XML_WARNINGS")) {