author | Pierre-Yves Ritschard <pyr@spootnik.org> | |
Wed, 19 Nov 2014 15:00:54 +0000 (16:00 +0100) | ||
committer | Pierre-Yves Ritschard <pyr@spootnik.org> | |
Wed, 19 Nov 2014 15:46:25 +0000 (16:46 +0100) | ||
commit | 9d6f72e5054cfbb183585991fefcf119259d71c4 | |
tree | f3ed440302d01b50c5d00ba08aeeffc38390c5e1 | tree | snapshot |
parent | 31246d467de836ac962ee65fa974e348a8fdd351 | commit | diff |
Let snmp_synch_response deal with PDU freeing
When reading from tables, upon errors the PDUs sent are already
freed by snmp_synch_response since they are right after
snmp_send is called.
This commit syncs collectd's approach with other occurences of
snmp_synch_response calls.
There might be a few corner cases where we leak PDUs, but it
is unclear how to check for those since we would need to
have an indication that snmp_send was never called, which
as far as I can tell is not possible.
The potential for failure in snmp_send is rather low and will
be easily spotted though, since when crafting invalid PDUs
snmp send will constantly fail and since valid configurations
can never leak memory.
This fixes #804
When reading from tables, upon errors the PDUs sent are already
freed by snmp_synch_response since they are right after
snmp_send is called.
This commit syncs collectd's approach with other occurences of
snmp_synch_response calls.
There might be a few corner cases where we leak PDUs, but it
is unclear how to check for those since we would need to
have an indication that snmp_send was never called, which
as far as I can tell is not possible.
The potential for failure in snmp_send is rather low and will
be easily spotted though, since when crafting invalid PDUs
snmp send will constantly fail and since valid configurations
can never leak memory.
This fixes #804
src/snmp.c | diff | blob | history |