I want to implement a C subroutine, in which memory is allocated using malloc or calloc. The subroutine gets the address of a pointer (defined in the main function) as input and makes that pointer point to the allocated memory block. Now I am wondering whether that memory block will still be available after the subroutine is terminated and execution of the main function proceeds, or whether I might run into trouble.