Arrays for coalescing can get too big for the stack.

This commit is contained in:
Eric Fischer 2014-09-29 15:59:36 -07:00
parent 98b0cb5e3f
commit 099623cd32

View File

@ -511,7 +511,7 @@ long long write_tile(struct index *start, struct index *end, char *metabase, uns
}
int nfeatures = 0;
struct coalesce features[end - start];
struct coalesce *features = (struct coalesce *) malloc((end - start) * sizeof(struct coalesce));
struct index *i;
for (i = start; i < end; i++) {
@ -642,6 +642,8 @@ long long write_tile(struct index *start, struct index *end, char *metabase, uns
free(features[x].meta);
}
free(features);
struct pool_val *pv;
for (pv = keys.head; pv != NULL; pv = pv->next) {
layer->add_keys(pv->s, strlen(pv->s));