Importing Upstream version 4.8.2
[platform/upstream/gcc48.git] / libmudflap / mf-hooks1.c
index 3dd332e..474c835 100644 (file)
@@ -1,5 +1,5 @@
 /* Mudflap: narrow-pointer bounds-checking by tree rewriting.
-   Copyright (C) 2002, 2003, 2004, 2009, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2002-2013 Free Software Foundation, Inc.
    Contributed by Frank Ch. Eigler <fche@redhat.com>
    and Graydon Hoare <graydon@redhat.com>
 
@@ -238,11 +238,11 @@ WRAPPER(void, free, void *buf)
   static int freeq_initialized = 0;
   DECLARE(void, free, void *);
 
-  BEGIN_PROTECT (free, buf);
-
   if (UNLIKELY(buf == NULL))
     return;
 
+  BEGIN_PROTECT (free, buf);
+
 #if PIC
   /* Check whether the given buffer might have come from a
      __mf_0fn_malloc/calloc call that for whatever reason was not