diff options
author | Benny Prijono <bennylp@teluu.com> | 2008-07-14 16:58:11 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2008-07-14 16:58:11 +0000 |
commit | 08201cb1699089d3a04e55eb7437d84c96fd590a (patch) | |
tree | 9443fb5595abe6992c5840c510bb67d605f15d4c /pjlib/src/pj | |
parent | 4f687978b8878cb59675e290438ff94ed322fb94 (diff) |
Ticket #568: The hash table ignores the last row of the table in hash table iteration, causing some memory leaks during shutdown routine because some objects are not destroyed
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2138 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src/pj')
-rw-r--r-- | pjlib/src/pj/hash.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pjlib/src/pj/hash.c b/pjlib/src/pj/hash.c index ffebeea4..fb1fdcac 100644 --- a/pjlib/src/pj/hash.c +++ b/pjlib/src/pj/hash.c @@ -276,7 +276,7 @@ PJ_DEF(pj_hash_iterator_t*) pj_hash_first( pj_hash_table_t *ht, it->index = 0; it->entry = NULL; - for (; it->index < ht->rows; ++it->index) { + for (; it->index <= ht->rows; ++it->index) { it->entry = ht->table[it->index]; if (it->entry) { break; @@ -294,7 +294,7 @@ PJ_DEF(pj_hash_iterator_t*) pj_hash_next( pj_hash_table_t *ht, return it; } - for (++it->index; it->index < ht->rows; ++it->index) { + for (++it->index; it->index <= ht->rows; ++it->index) { it->entry = ht->table[it->index]; if (it->entry) { break; @@ -319,7 +319,7 @@ void pj_hash_dump_collision( pj_hash_table_t *ht ) char line[120]; int len, totlen = 0; - for (i=0; i<ht->rows; ++i) { + for (i=0; i<=ht->rows; ++i) { unsigned count = 0; pj_hash_entry *entry = ht->table[i]; while (entry) { |