-
- if ((list_len + 1) >= list_size)
- {
- int *new_ptr;
- int new_size = 2 * list_size;
- /* Comes in sizes: 2, 4, 8, 16, ... */
-
- new_ptr = (int *) realloc (list, (size_t) (sizeof (int) * new_size));
- if (new_ptr == NULL)
- {
- if (list != NULL)
- free (list);
- ERROR ("processes plugin: "
- "Failed to allocate more memory.");
- return (NULL);
- }
-
- list = new_ptr;
- list_size = new_size;
-
- memset (list + list_len, 0, sizeof (int) * (list_size - list_len));
- }
-
- list[list_len] = atoi (ent->d_name);
- if (list[list_len] != 0)
- list_len++;