107 |
|
register COLR *cs; |
108 |
|
int n; |
109 |
|
{ |
110 |
< |
static short (*cerr)[3]; |
110 |
> |
static short (*cerr)[3] = NULL; |
111 |
|
static int N = 0; |
112 |
|
int err[3], errp[3]; |
113 |
|
register int x, i; |
114 |
|
|
115 |
|
if (n != N) { /* get error propogation array */ |
116 |
< |
if (N) |
117 |
< |
cerr = (short (*)[3])realloc((char *)cerr, |
118 |
< |
3*n*sizeof(short)); |
119 |
< |
else |
116 |
> |
if (N) { |
117 |
> |
free((char *)cerr); |
118 |
> |
cerr = NULL; |
119 |
> |
} |
120 |
> |
if (n) |
121 |
|
cerr = (short (*)[3])malloc(3*n*sizeof(short)); |
122 |
|
if (cerr == NULL) { |
123 |
|
N = 0; |