Commit 0c8eb72e authored by Clément Bœsch's avatar Clément Bœsch Committed by Michael Niedermayer

Avoid pointless check before calling free

Signed-off-by: 's avatarMans Rullgard <mans@mansr.com>
(cherry picked from commit dc75d6db)
parent cf96cce7
...@@ -138,12 +138,11 @@ void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size) ...@@ -138,12 +138,11 @@ void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size)
void av_free(void *ptr) void av_free(void *ptr)
{ {
/* XXX: this test should not be needed on most libcs */
if (ptr)
#if CONFIG_MEMALIGN_HACK #if CONFIG_MEMALIGN_HACK
if (ptr)
free((char*)ptr - ((char*)ptr)[-1]); free((char*)ptr - ((char*)ptr)[-1]);
#else #else
free(ptr); free(ptr);
#endif #endif
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment