httplib_strdup( str );
||Pointer to the source string which must be duplicated|
||Pointer to the duplicate, or NULL if an error occured|
httplib_strdup() duplicates a NUL terminated string to a new string. The duplicate is stored in a newly allocated block of memory. The function is equivalent to the Posix
strdup() function with the difference that the LibHTTP memory allocation functions are used which allow for tracking of allocation requests and memory leaks through a monitor hook.
If the duplicate of the string is no longer used, the allocated memory should be returned to the heap with a call to
If the function fails the value
NULL is returned, otherwise a pointer to the duplicate. Failure can be either through an invalid parameter in the function call, or an out of memory situation when allocating space for the duplicate.