From 4fe12100984a41d439dc9b4138d6cd8df36285f8 Mon Sep 17 00:00:00 2001 From: Peter Verthez Date: Sat, 5 Jan 2002 14:01:43 +0000 Subject: [PATCH] Bugfixes in using the hash implementation of kazlib. --- gedcom/encoding.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gedcom/encoding.c b/gedcom/encoding.c index 7e00f76..23e65bd 100644 --- a/gedcom/encoding.c +++ b/gedcom/encoding.c @@ -33,7 +33,6 @@ #define ENCODING_CONF_FILE "gedcom.enc" #define GCONV_SEARCH_PATH "GCONV_PATH" #define MAXBUF 255 -#define INIT_NR_ENCODINGS 10 static iconv_t cd_to_internal = (iconv_t) -1; static ENCODING the_enc = ONE_BYTE; @@ -67,6 +66,8 @@ void add_encoding(char *gedcom_n, char* charwidth, char *iconv_n) if (hash_lookup(encodings, key)) { gedcom_warning(_("Duplicate entry found for encoding '%s', ignoring"), gedcom_n); + free(key); + free(val); } else { hash_alloc_insert(encodings, key, val); @@ -133,7 +134,7 @@ void init_encodings() } } - encodings = hash_create(INIT_NR_ENCODINGS, NULL, NULL); + encodings = hash_create(HASHCOUNT_T_MAX, NULL, NULL); hash_set_allocator(encodings, node_alloc, node_free, NULL); /* Open gedcom configuration file and read */ -- 2.30.2