| VLC
    3.0.18
    | 
| Files | |
| file | vlc_memory.h | 
| Functions | |
| static void * | realloc_or_free (void *p, size_t sz) | 
| This wrapper around realloc() will free the input pointer when realloc() returns NULL.  More... | |
| 
 | inlinestatic | 
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).
References p.
Referenced by vlc_config_create(), and vlc_stream_ReadLine().
 1.8.16
 1.8.16