Allocate memory

If the function allocates memory, this memory is only allocated within the function itself and is freed before the function returns.

No library function allocates memory that remains after the function returns. Therefore, you must allocate any memory for data that the function needs or returns.

DataBlade® UDRs can assume that the functions allocate memory with a PER_ROUTINE memory duration.

You must ensure that memory is allocated for any return value or argument that the function provides to the calling program.

Tip: You must also handle memory allocation for multibyte-character and wide-character strings that the functions use.