bgoglin_at_[hidden], le Tue 04 May 2010 01:32:00 -0400, a écrit :
> @@ -326,6 +330,10 @@
> if (nr_tids == max_tids) {
> max_tids += 8;
> tids = realloc(tids, max_tids*sizeof(pid_t));
> + if (!tids) {
> + errno = ENOMEM;
> + return -1;
> + }
> }
> if (!strcmp(dirent->d_name, ".") || !strcmp(dirent->d_name, ".."))
> continue;
We also need to free the original allocated array.
Samuel
|