fftools/cmdutils: add error handling to allocate_array_elem()

This commit is contained in:
Anton Khirnov
2023-07-13 17:50:16 +02:00
parent 8eb5adeab8
commit 6be4a29397
5 changed files with 51 additions and 14 deletions

View File

@@ -430,13 +430,12 @@ void *grow_array(void *array, int elem_size, int *size, int new_size);
* Atomically add a new element to an array of pointers, i.e. allocate
* a new entry, reallocate the array of pointers and make the new last
* member of this array point to the newly allocated buffer.
* Calls exit() on failure.
*
* @param array array of pointers to reallocate
* @param elem_size size of the new element to allocate
* @param nb_elems pointer to the number of elements of the array array;
* *nb_elems will be incremented by one by this function.
* @return pointer to the newly allocated entry
* @return pointer to the newly allocated entry or NULL on failure
*/
void *allocate_array_elem(void *array, size_t elem_size, int *nb_elems);