The change updates the test code for the calloc function to handle the case where calloc returns NULL, which can happen if the nmemb or size parameter is 0 or if the function is unable to allocate memory. The updated test case explicitly checks for a NULL pointer before attempting to free it, which avoids the potential for undefined behavior caused by attempting to free a deallocated pointer. The change ensures that the test code follows the behavior described in the man page for calloc and should be portable across different systems and versions of the C standard library.
The change updates the test code for the calloc function to handle the case where calloc returns NULL, which can happen if the nmemb or size parameter is 0 or if the function is unable to allocate memory. The updated test case explicitly checks for a NULL pointer before attempting to free it, which avoids the potential for undefined behavior caused by attempting to free a deallocated pointer. The change ensures that the test code follows the behavior described in the man page for calloc and should be portable across different systems and versions of the C standard library.
@alelievr Are you okay?