BUG/MINOR: connection: prevent null deref on mux cleanup task allocation
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 16 Sep 2021 10:15:12 +0000 (12:15 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 16 Sep 2021 15:45:52 +0000 (17:45 +0200)
commit4837293ca0a1cc8c55ee9b84e66ee30bc755c291
treec447d36b7999b4411aa526af027e307e1a0b5489
parented8bfadd8d17fc59b8a1f57bb2476cd7df1ce190
BUG/MINOR: connection: prevent null deref on mux cleanup task allocation

Move the code to allocate/free the mux cleanup task outside of the polling
loop. A new thread_alloc/free handler is registered for this in
connection.c.

This has the benefit to clean up the polling loop code. And as another
benefit, if the task allocation fails, the handler can report an error
to exit the haproxy process. This prevents a potential null pointer
dereferencing.

This should fix the github issue #1389.

This must be backported up to 2.4.
src/connection.c
src/haproxy.c