From 4670eb519465256e88099fbabb0dd08cadaad22d Mon Sep 17 00:00:00 2001 From: Robert James Kaes Date: Thu, 6 Sep 2001 21:52:31 +0000 Subject: Make sure that freeptr actually points to something before we try to invoke it. --- src/ternary.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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); } } -- cgit v1.2.3