Skip to content

Commit 135c66f

Browse files
committed
BUG/MEDIUM: connection: fix pool free regression with recent ppv2 TLV patches
In commit fecc573 ("MEDIUM: connection: Generic, list-based allocation and look-up of PPv2 TLVs") there was a tiny mistake, elements of length <= 128 are allocated from pool_pp_128 but only those of length < 128 are released to this pool, other ones go to pool_pp_256. Because of this, elements of size exactly 128 are allocated from 128 and released to 256. It can be reproduced a few times by running sample_fetches/tlvs.vtc 1000 times with -DDEBUG_DONT_SHARE_POOLS -DDEBUG_MEMORY_POOLS -DDEBUG_EXPR -DDEBUG_STRICT=2 -DDEBUG_POOL_INTEGRITY -DDEBUG_POOL_TRACING -DDEBUG_NO_POOLS. Not sure why it doesn't reproduce more often though. No backport is needed. This should address github issues haproxy#2275 and haproxy#2274.
1 parent d524667 commit 135c66f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/connection.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ void conn_free(struct connection *conn)
569569
LIST_DELETE(&tlv->list);
570570
if (tlv->len > HA_PP2_TLV_VALUE_256)
571571
free(tlv);
572-
else if (tlv->len < HA_PP2_TLV_VALUE_128)
572+
else if (tlv->len <= HA_PP2_TLV_VALUE_128)
573573
pool_free(pool_head_pp_tlv_128, tlv);
574574
else
575575
pool_free(pool_head_pp_tlv_256, tlv);

0 commit comments

Comments
 (0)