From f178c1aaf71fda7178990a0b5bf8f7910af7c87e Mon Sep 17 00:00:00 2001 From: mig Date: Sat, 19 Mar 2011 19:44:20 +0000 Subject: early return on freeing a NULL pointer --- generic/tclAlloc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/generic/tclAlloc.c b/generic/tclAlloc.c index 85f7036..9c0ab02 100644 --- a/generic/tclAlloc.c +++ b/generic/tclAlloc.c @@ -686,16 +686,16 @@ TclpFree( Block *blockPtr; int bucket; + if (ptr == NULL) { + return; + } + if (allocator < aNONE) { return free((char *) ptr); } GETCACHE(cachePtr); - if (ptr == NULL) { - return; - } - /* * Get the block back from the user pointer and call system free directly * for large blocks. Otherwise, push the block back on the bucket and move -- cgit v0.12