]> git.ipfire.org Git - thirdparty/lldpd.git/commit
lib: fix memory leak when handling I/O
authorVincent Bernat <vincent@bernat.ch>
Mon, 11 Nov 2019 08:54:10 +0000 (09:54 +0100)
committerVincent Bernat <vincent@bernat.ch>
Mon, 11 Nov 2019 09:36:08 +0000 (10:36 +0100)
commit9c49cedf8e75046f8524728f5c06198b98c41512
tree554437dc7ac3571ffc386420de93f894c53a8672
parent7056d802b9c595dd16f1354649bb7ae2f8b8880c
lib: fix memory leak when handling I/O

The state data is used to ensure we don't interleave requests of the
same kind (eg requesting data for eth0, then for eth1 while eth0 is
running). The data was freed only when reaching `CONN_STATE_IDLE`
again. Otherwise, there was a memory leak.

To avoid the memory leak, we avoid use a static allocation instead.

Fix #362.
src/lib/atom.c
src/lib/atom.h
src/lib/atoms/port.c