lh_TYPE_doall(lh, lh_TYPE_delete). Not doing so may dereference
dead memory when traversing to next item in hash table.
One has to call lh_TYPE_set_down_load(lh, 0) to disable hash
table contraction when table is being destroyed during the
_doall() traversal.
call lh_TYPE_set_down_load(lh, 0) before doing
lh_TYPE_daall() with lh_TYPE_delete(). This disables
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Wed Mar 18 17:26:44 2026
(Merged from https://github.com/openssl/openssl/pull/30371)
lh_SRTM_ITEM_free(srtm->items_rev);
if (srtm->items_fwd != NULL) {
+ /*
+ * We don't need to call lh_SRTM_ITEM_set_set_down(..., 0)
+ * here because srtm_free_each() callback for _doall() does
+ * not call to lh_SRTIM_ITEM_delete().
+ */
lh_SRTM_ITEM_doall(srtm->items_fwd, srtm_free_each);
lh_SRTM_ITEM_free(srtm->items_fwd);
}
void ossl_quic_stream_map_cleanup(QUIC_STREAM_MAP *qsm)
{
+ lh_QUIC_STREAM_set_down_load(qsm->map, 0);
ossl_quic_stream_map_visit(qsm, release_each, qsm);
lh_QUIC_STREAM_free(qsm->map);