summaryrefslogtreecommitdiff
path: root/src/htshash.c
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2013-06-26 20:06:50 +0000
committerXavier Roche <xroche@users.noreply.github.com>2013-06-26 20:06:50 +0000
commita835ee13e3f5a095467e645bd1ddea5ee208599e (patch)
treed7412dd6f882ee6b55f97a3b74c6d56705ca7ccc /src/htshash.c
parentb5e663cd80904d70ad2f0d6202a0c3ce6e582b58 (diff)
Fixed old 3-hashtable missing free on exit
Always use default starting hash size
Diffstat (limited to 'src/htshash.c')
-rw-r--r--src/htshash.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/htshash.c b/src/htshash.c
index 1ac20ee..daf987c 100644
--- a/src/htshash.c
+++ b/src/htshash.c
@@ -57,7 +57,6 @@ Please visit our Website: http://www.httrack.com
// GESTION DES TABLES DE HACHAGE
// Méthode à 2 clés (adr+fil), 2e cle facultative
// hash[no_enregistrement][pos]->hash est un index dans le tableau général liens
-// #define HTS_HASH_SIZE 8191 (premier si possible!)
// type: numero enregistrement - 0 est case insensitive (sav) 1 (adr+fil) 2 (former_adr+former_fil)
// recherche dans la table selon nom1,nom2 et le no d'enregistrement
@@ -67,6 +66,14 @@ void hash_init(hash_struct * hash) {
hash->former_adrfil = inthash_new(0);
}
+void hash_free(hash_struct *hash) {
+ if (hash != NULL) {
+ inthash_delete(&hash->sav);
+ inthash_delete(&hash->adrfil);
+ inthash_delete(&hash->former_adrfil);
+ }
+}
+
static char * normalize_key(const char *nom1, const char *nom2,
hash_struct_type type, int normalized,
char *normfil_, char *catbuff) {