--- ray/src/common/urand.c 1991/06/07 10:47:17 1.4 +++ ray/src/common/urand.c 1992/09/05 13:40:55 2.2 @@ -1,11 +1,11 @@ -/* Copyright (c) 1991 Regents of the University of California */ +/* Copyright (c) 1992 Regents of the University of California */ #ifndef lint static char SCCSid[] = "$SunId$ LBL"; #endif /* - * Uncorrelated (anticorrelated) random function + * Anticorrelated random function due to Christophe Schlick */ #include "random.h" @@ -14,7 +14,7 @@ static char SCCSid[] = "$SunId$ LBL"; extern char *malloc(); -short *urperm; /* urand() permutation */ +short *urperm = NULL; /* urand() permutation */ int urmask; /* bits used in permutation */ @@ -24,6 +24,8 @@ int size; int order, n; register int i, offset; + if (urperm != NULL) + free((char *)urperm); size--; for (i = 1; size >>= 1; i++) ;