summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert James Kaes <rjkaes@users.sourceforge.net>2001-09-06 21:52:31 +0000
committerRobert James Kaes <rjkaes@users.sourceforge.net>2001-09-06 21:52:31 +0000
commit4670eb519465256e88099fbabb0dd08cadaad22d (patch)
tree6d7ec4ed712698c3484fc5320e106aa64dbcd9c3 /src
parentf2312262c77f4c2a5e35b984a9a012e8332690d4 (diff)
downloadtinyproxy-4670eb519465256e88099fbabb0dd08cadaad22d.tar.gz
tinyproxy-4670eb519465256e88099fbabb0dd08cadaad22d.zip
Make sure that freeptr actually points to something before we try to
invoke it.
Diffstat (limited to '')
-rw-r--r--src/ternary.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ternary.c b/src/ternary.c
index 2917149..9ced4d9 100644
--- a/src/ternary.c
+++ b/src/ternary.c
@@ -1,4 +1,4 @@
-/* $Id: ternary.c,v 1.7 2001-09-04 17:53:41 rjkaes Exp $
+/* $Id: ternary.c,v 1.8 2001-09-06 21:52:31 rjkaes Exp $
*
* This module creates a Ternary Search Tree which can store both string
* keys, and arbitrary data for each key. It works similar to a hash, and
@@ -269,7 +269,8 @@ int ternary_destroy(TERNARY tno, void (*freeptr)(void *))
for (j = 0; j < BUFSIZE; j++) {
Tnode *ptr = (trees[cur]->freearr[i] + j);
if (ptr->splitchar == 0)
- (*freeptr)(ptr->eqkid);
+ if (freeptr)
+ (*freeptr)(ptr->eqkid);
safefree(ptr);
}
}