]> git.ipfire.org Git - thirdparty/lldpd.git/commit
lib: fix memory leak when handling I/O fix/memory-leak-in-atom-2
authorVincent Bernat <vincent@bernat.ch>
Fri, 8 Nov 2019 13:44:43 +0000 (14:44 +0100)
committerVincent Bernat <vincent@bernat.ch>
Sat, 9 Nov 2019 16:56:39 +0000 (17:56 +0100)
commit1a79cfa440e4486b274120c6377b076422949f5f
tree2d7fd904c7c0c98da2d2f5758c3995061f698c84
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.

This is an attempt to rework the code to avoid the memory leak.
However, we still get a memory leak on error case because we don't
know the difference between an hard error case or simply a request to
wait for more bytes. See #362 for the discussion.
src/lib/atom.c