From: Zdeněk Šustr Date: Tue, 31 May 2011 08:19:58 +0000 (+0000) Subject: - proper order of causality X-Git-Tag: glite-lb-client_R_4_1_10_1~9 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=a606d61982f1f3fc3f8a0af03d682287fffc04d4;p=jra1mw.git - proper order of causality - removed erroneous free() call for host entry structure --- diff --git a/org.glite.jobid.api-c/src/cjobid.c b/org.glite.jobid.api-c/src/cjobid.c index e046b0c..57da65c 100644 --- a/org.glite.jobid.api-c/src/cjobid.c +++ b/org.glite.jobid.api-c/src/cjobid.c @@ -59,17 +59,16 @@ int glite_jobid_recreate(const char* bkserver, int port, const char *unique, gli return EINVAL; if (unique == NULL) { + gettimeofday(&tv, NULL); srandom(tv.tv_usec); gethostname(hostname, 100); he = gethostbyname(hostname); if (!he) asprintf(&rndaddr,"%d.%d.%d.%d",rand()%256,rand()%256,rand()%256,rand()%256); - gettimeofday(&tv, NULL); skip = strlen(hostname); skip += sprintf(hostname + skip, "-IP:0x%x-pid:%d-rnd:%d-time:%d:%d", rndaddr ? rndaddr : *((int*)he->h_addr_list[0]), getpid(), (int)random(), (int)tv.tv_sec, (int)tv.tv_usec); - free(he); free(rndaddr); }