diff options
-rw-r--r-- | include/xine/xineutils.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/xine/xineutils.h b/include/xine/xineutils.h index 8e3394afd..3a997d2c2 100644 --- a/include/xine/xineutils.h +++ b/include/xine/xineutils.h @@ -143,6 +143,16 @@ void *xine_xmalloc(size_t size) XINE_MALLOC XINE_DEPRECATED XINE_PROTECTED; void *xine_xcalloc(size_t nmemb, size_t size) XINE_MALLOC XINE_PROTECTED; /* + * Free allocated memory and set pointer to NULL + * @param ptr Pointer to the pointer to the memory block which should be freed. + */ +static inline void _x_freep(void *ptr) XINE_PROTECTED { + void **p = (void **)ptr; + free (*p); + *p = NULL; +} + +/* * Copy blocks of memory. */ void *xine_memdup (const void *src, size_t length) XINE_MALLOC XINE_PROTECTED; |