summaryrefslogtreecommitdiffstats
path: root/crypto/lhash/lhash.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2000-03-18 15:18:27 +0000
committerBodo Möller <bodo@openssl.org>2000-03-18 15:18:27 +0000
commit6e22639f4640b702d9d8636265c685448ca64145 (patch)
tree7628095b308c3c9570acb0343b856adaaa2c9f13 /crypto/lhash/lhash.c
parentcde245bdcd5ff4ef580030a0c1881f307d38a6ae (diff)
Eliminate memory leaks in mem_dbg.c.
Diffstat (limited to 'crypto/lhash/lhash.c')
-rw-r--r--crypto/lhash/lhash.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/crypto/lhash/lhash.c b/crypto/lhash/lhash.c
index 512c8bc84c..7eb92a18bc 100644
--- a/crypto/lhash/lhash.c
+++ b/crypto/lhash/lhash.c
@@ -422,21 +422,6 @@ static LHASH_NODE **getrn(LHASH *lh, void *data, unsigned long *rhash)
return(ret);
}
-/*
-unsigned long lh_strhash(char *str)
- {
- int i,l;
- unsigned long ret=0;
- unsigned short *s;
-
- if (str == NULL) return(0);
- l=(strlen(str)+1)/2;
- s=(unsigned short *)str;
- for (i=0; i<l; i++)
- ret^=(s[i]<<(i&0x0f));
- return(ret);
- } */
-
/* The following hash seems to work very well on normal text strings
* no collisions on /usr/dict/words and it distributes on %2^n quite
* well, not as good as MD5, but still good.
@@ -470,3 +455,7 @@ unsigned long lh_strhash(const char *c)
return((ret>>16)^ret);
}
+unsigned long lh_num_items(LHASH *lh)
+ {
+ return lh ? lh->num_items : 0;
+ }