leak-checker: Avoid printing freed pointer.
authorBen Pfaff <blp@nicira.com>
Wed, 23 Feb 2011 18:31:41 +0000 (10:31 -0800)
committerBen Pfaff <blp@nicira.com>
Wed, 23 Feb 2011 23:14:42 +0000 (15:14 -0800)
I think that this will work OK, and it should avoid complaints from static
checkers about using a freed pointer.

Coverity #11069.

lib/leak-checker.c

index 8b781824417212c08b79b9851824566dbcce3748..42b3818ab511f2a469b08c5145efc60e86938aa7 100644 (file)
@@ -216,11 +216,10 @@ hook_free(void *p, const void *caller OVS_UNUSED)
     }
 
     set_hooks(&libc_hooks);
+    log_callers("free(%p)", p);
     free(p);
     get_hooks(&libc_hooks);
 
-    log_callers("free(%p)", p);
-
     reset_hooks();
 }