]> git.ipfire.org Git - thirdparty/lldpd.git/commit
lib: fix memory leak when handling I/O fix/memory-leak-in-atom-4
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:32:31 +0000 (10:32 +0100)
commite9e325cb6edaab4911b543623faefc13bfb68362
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.
See #362 for the discussion.
src/lib/atom.c
src/lib/atom.h
src/lib/atoms/port.c