diff options
author | mig <mig> | 2011-03-19 19:44:20 (GMT) |
---|---|---|
committer | mig <mig> | 2011-03-19 19:44:20 (GMT) |
commit | f178c1aaf71fda7178990a0b5bf8f7910af7c87e (patch) | |
tree | 0e1fb747e9de77ea091cebe9deaee58355eb9988 | |
parent | 8acfdb842be3b3b543602a913afd70257c3adbe1 (diff) | |
download | tcl-f178c1aaf71fda7178990a0b5bf8f7910af7c87e.zip tcl-f178c1aaf71fda7178990a0b5bf8f7910af7c87e.tar.gz tcl-f178c1aaf71fda7178990a0b5bf8f7910af7c87e.tar.bz2 |
early return on freeing a NULL pointer
-rw-r--r-- | generic/tclAlloc.c | 8 |
1 files 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 |