environ #15

Merged
cromer merged 27 commits from environ into master 2021-07-17 22:15:24 -04:00
Showing only changes of commit 2d6303e311 - Show all commits

View File

@ -30,6 +30,10 @@ static CleanArray clean;
*/ */
void add_to_cleanup(void *data) { void add_to_cleanup(void *data) {
clean.array = realloc(clean.array, (clean.size + 1) * sizeof(void *)); clean.array = realloc(clean.array, (clean.size + 1) * sizeof(void *));
if (clean.array == NULL) {
perror("realloc");
exit(EXIT_FAILURE);
}
clean.array[clean.size++] = data; clean.array[clean.size++] = data;
} }