- proper order of causality
authorZdeněk Šustr <sustr4@cesnet.cz>
Tue, 31 May 2011 08:19:58 +0000 (08:19 +0000)
committerZdeněk Šustr <sustr4@cesnet.cz>
Tue, 31 May 2011 08:19:58 +0000 (08:19 +0000)
- removed erroneous free() call for host entry structure

org.glite.jobid.api-c/src/cjobid.c

index e046b0c..57da65c 100644 (file)
@@ -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);
     }