xant / libhl

Simple and fast C library implementing a thread-safe API to manage hash-tables, linked lists, lock-free ring buffers and queues
GNU Lesser General Public License v3.0
420 stars 117 forks source link

count not updated when removing items using the iterator #26

Closed zhs077 closed 4 years ago

zhs077 commented 5 years ago

ht_foreach_pair when ,ht_pair_iterator_callback_t fun return value < 0, the hash count not decrement 1

xant commented 4 years ago

Fixed in 8de0c6989bc35b65e90688bd13ceb74bc38a1c5d

xant commented 4 years ago

Note that this wasn't exactly a leak. No memory was actually leaked but the internal items count was left indeed wrong, hence this still was a serious bug. Thanks for reporting.