From b67afb81eb0f7ad89496cd3e672654bfd8c55d0e Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 21 Mar 2020 20:03:13 -0700 Subject: [PATCH] snmpd: UCD-SNMP proxy: Fix a crash triggered by a wrong passphrase See also https://github.com/net-snmp/net-snmp/issues/82 . --- agent/mibgroup/ucd-snmp/proxy.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/agent/mibgroup/ucd-snmp/proxy.c b/agent/mibgroup/ucd-snmp/proxy.c index f4eb03ef6f..548ae7588f 100644 --- a/agent/mibgroup/ucd-snmp/proxy.c +++ b/agent/mibgroup/ucd-snmp/proxy.c @@ -698,8 +698,6 @@ proxy_got_response(int operation, netsnmp_session * sess, int reqid, "proxy OID return length too long.\n"); netsnmp_set_request_error(cache->reqinfo, requests, SNMP_ERR_GENERR); - if (pdu) - snmp_free_pdu(pdu); netsnmp_free_delegated_cache(cache); return 1; } @@ -723,8 +721,6 @@ proxy_got_response(int operation, netsnmp_session * sess, int reqid, * ack, this is bad. The # of varbinds don't match and * there is no way to fix the problem */ - if (pdu) - snmp_free_pdu(pdu); snmp_log(LOG_ERR, "response to proxy request illegal. We're screwed.\n"); netsnmp_set_request_error(cache->reqinfo, requests, @@ -735,11 +731,6 @@ proxy_got_response(int operation, netsnmp_session * sess, int reqid, if (cache->reqinfo->mode == MODE_GETBULK) netsnmp_bulk_to_next_fix_requests(requests); - /* - * free the response - */ - if (pdu && 0) - snmp_free_pdu(pdu); break; default: