Functions

Memory

Functions

static void * realloc_or_free (void *p, size_t sz)
 This wrapper around realloc() will free the input pointer when realloc() returns NULL.

Function Documentation

static void* realloc_or_free ( void *  p,
size_t  sz 
) [inline, static]

This wrapper around realloc() will free the input pointer when realloc() returns NULL.

The use case ptr = realloc(ptr, newsize) will cause a memory leak when ptr pointed to a heap allocation before, leaving the buffer allocated but unreferenced. vlc_realloc() is a drop-in replacement for that use case (and only that use case).

Referenced by AStreamPeekBlock(), AStreamPeekStream(), DownloadArt(), stream_ReadLine(), and vlc_config_create().

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines