Avoid pointless check before calling free
authorClément Bœsch <ubitux@gmail.com>
Thu, 3 Feb 2011 00:40:35 +0000 (01:40 +0100)
committerMans Rullgard <mans@mansr.com>
Thu, 3 Feb 2011 01:36:00 +0000 (01:36 +0000)
Signed-off-by: Mans Rullgard <mans@mansr.com>
libavutil/mem.c

index 18fe28b..7ffd6cb 100644 (file)
@@ -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
 }