From 0c8eb72ec5183909d87d8bba5c3b17337635c02a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= Date: Thu, 3 Feb 2011 01:40:35 +0100 Subject: [PATCH] Avoid pointless check before calling free Signed-off-by: Mans Rullgard (cherry picked from commit dc75d6dbf2af3c03b33d3159e1dadccf22c076ea) --- libavutil/mem.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavutil/mem.c b/libavutil/mem.c index 18fe28b7ce..7ffd6cba9b 100644 --- a/libavutil/mem.c +++ b/libavutil/mem.c @@ -138,12 +138,11 @@ void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size) void av_free(void *ptr) { - /* XXX: this test should not be needed on most libcs */ - if (ptr) #if CONFIG_MEMALIGN_HACK + if (ptr) free((char*)ptr - ((char*)ptr)[-1]); #else - free(ptr); + free(ptr); #endif }