BUG/MINOR: hpack: fix harmless use of uninitialized value in hpack_dht_insert
authorWilly Tarreau <w@1wt.eu>
Tue, 27 Mar 2018 13:06:02 +0000 (15:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 27 Mar 2018 18:05:13 +0000 (20:05 +0200)
commita7394e1b72706abcd5bdda254dfd86877fee400b
treee7ecc4c75bcad670637a7b6a2527948e2f7790d7
parent56cc12509cf8b266a39131e0fa7b2dbbc48ce63e
BUG/MINOR: hpack: fix harmless use of uninitialized value in hpack_dht_insert

A warning is reported here by valgrind on first pass in hpack_dht_insert().
The cause is that the not-yet-initialized dht->head is checked in
hpack_dht_get_tail(), though the result is not used, making it have
no impact. At the very least it confuses valgrind, and maybe it makes
it harder for gcc to optimize the code path. Let's move the variable
initialization around to shut it up. Thanks to Olivier for reporting
this one.

This fix may be backported to 1.8 at least to make valgrind usage less
painful.
src/hpack-tbl.c