| 570afb92 | 01-Jan-2017 |
Enji Cooper <[email protected]> |
Call snmp_pdu_free on req/resp with a consistent, correct pattern
- snmp_pdu_free should be called before snmp_pdu_create is called again - snmp_pdu_free should be called on the resp to snmp_dialo
Call snmp_pdu_free on req/resp with a consistent, correct pattern
- snmp_pdu_free should be called before snmp_pdu_create is called again - snmp_pdu_free should be called on the resp to snmp_dialog when successful
Tested with the following bsnmp commands:
% export SNMPUSER=bsnmp SNMPPASSWD=bsnmptest % SNMP_ARGS="-A proto=sha -C context='' -K -P proto=des -v 3 -r 0" % bsnmpset $SNMP_ARGS sysLocation="MyAgent" % bsnmpget $SNMP_ARGS sysLocation % bsnmpwalk $SNMP_ARGS
MFC after: 12 days X-MFC with: r310729, r310892, r310894
show more ...
|
| 86b3c169 | 31-Dec-2016 |
Enji Cooper <[email protected]> |
snmp_output_err_resp, snmp_output_resp: allocate `object` using calloc, not on the stack
Some of the callers try to determine whether or not `object` is valid by testing the value for NULL, which wi
snmp_output_err_resp, snmp_output_resp: allocate `object` using calloc, not on the stack
Some of the callers try to determine whether or not `object` is valid by testing the value for NULL, which will never be true if it's a stack value, so in order to be clear and correct down the call stack, use a heap allocated object.
This also addresses a Coverity issue by initializing all of `object` via calloc
MFC after: 1 week Reported by: Coverity CID: 1006392
show more ...
|
| 1b135e4f | 31-Dec-2016 |
Enji Cooper <[email protected]> |
snmp_pdu_free the right object at the right time in snmptool_walk
r310892 was on the right track, but unfortunately it was resolving the problem incorrectly and accidentally leaking memory in the pr
snmp_pdu_free the right object at the right time in snmptool_walk
r310892 was on the right track, but unfortunately it was resolving the problem incorrectly and accidentally leaking memory in the process.
- Call snmp_pdu_free on req before calling snmp_pdu_create on it at the bottom of the outer while loop - Call snmp_pdu_free on resp after calling snmpwalk_nextpdu_create in the inner loop
MFC after: 12 days X-MFC with: r310729, r310892 Reported by: valgrind
show more ...
|