uint16_t *oldarray = src->array;
src->array =
(uint16_t *)realloc(oldarray, src->capacity * sizeof(uint16_t));
- if (src->array == NULL) free(oldarray); // should never happen?
}
return savings;
}
if (preserve) {
container->array =
(uint16_t *)realloc(array, new_capacity * sizeof(uint16_t));
- if (container->array == NULL) free(array);
} else {
// Jon Strabala reports that some tools complain otherwise
if (array != NULL) {
src->capacity = src->n_runs;
rle16_t *oldruns = src->runs;
src->runs = (rle16_t *)realloc(oldruns, src->capacity * sizeof(rle16_t));
- if (src->runs == NULL) free(oldruns); // should never happen?
return savings;
}
/* Create a new run container. Return NULL in case of failure. */
rle16_t *oldruns = run->runs;
run->runs =
(rle16_t *)realloc(oldruns, run->capacity * sizeof(rle16_t));
- if (run->runs == NULL) free(oldruns);
} else {
// Jon Strabala reports that some tools complain otherwise
if (run->runs != NULL) {