From: Aleš Křenek Date: Thu, 14 Feb 2008 11:28:51 +0000 (+0000) Subject: Fix UserJobs via "GET /" X-Git-Tag: glite-yaim-myproxy_R_4_0_1_4~30 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=ed830bcaef6ae90638d9ef805b92308b3d2eeb66;p=jra1mw.git Fix UserJobs via "GET /" --- diff --git a/org.glite.lb.server/src/userjobs.c b/org.glite.lb.server/src/userjobs.c index 2566c73..2cfc045 100644 --- a/org.glite.lb.server/src/userjobs.c +++ b/org.glite.lb.server/src/userjobs.c @@ -70,13 +70,15 @@ int edg_wll_UserJobs( free(res); res = NULL; } - *states = calloc(njobs, sizeof(**states)); + if (states) *states = calloc(njobs, sizeof(**states)); for (i = 0; i < njobs; i++) { - if (edg_wll_JobStatus(ctx, out[i], -1, &(*states)[i]) != 0) { + edg_wll_JobStat *stat = states ? &(*states)[i] : NULL; + + if (stat && edg_wll_JobStatus(ctx, out[i], -1, stat) != 0) { for (j = 0; j < i; j++) edg_wll_FreeStatus(&(*states)[j]); *states = NULL; - break; } + break; } err: free(res);