Blame SOURCES/net-snmp-5.7.2-leak-backport.patch

92053a
diff -up net-snmp-5.7.2/snmplib/snmp_api.c.original net-snmp-5.7.2/snmplib/snmp_api.c
92053a
--- net-snmp-5.7.2/snmplib/snmp_api.c.original	2018-01-12 17:46:47.534166712 +0900
92053a
+++ net-snmp-5.7.2/snmplib/snmp_api.c	2018-01-12 17:48:09.420911255 +0900
92053a
@@ -4974,6 +4974,9 @@ _sess_async_send(void *sessp,
92053a
 
92053a
     reqid = pdu->reqid;
92053a
 
92053a
+    if (0 == reqid && (SNMPERR_SUCCESS == session->s_snmp_errno))
92053a
+        ++reqid;
92053a
+
92053a
     /*
92053a
      * Add to pending requests list if we expect a response.  
92053a
      */
92053a
diff -up net-snmp-5.7.2/snmplib/snmp_client.c.original net-snmp-5.7.2/snmplib/snmp_client.c
92053a
--- net-snmp-5.7.2/snmplib/snmp_client.c.original	2018-01-12 17:48:21.814721234 +0900
92053a
+++ net-snmp-5.7.2/snmplib/snmp_client.c	2018-01-12 18:33:55.779642445 +0900
92053a
@@ -1044,11 +1044,13 @@ snmp_synch_response_cb(netsnmp_session *
92053a
     ss->callback = pcb;
92053a
     ss->callback_magic = (void *) state;
92053a
 
92053a
-    if ((state->reqid = snmp_send(ss, pdu)) == 0) {
92053a
+    if (snmp_send(ss, pdu) == 0) {
92053a
         snmp_free_pdu(pdu);
92053a
         state->status = STAT_ERROR;
92053a
-    } else
92053a
+    } else {
92053a
+        state->reqid = pdu->reqid;
92053a
         state->waiting = 1;
92053a
+    }
92053a
 
92053a
     while (state->waiting) {
92053a
         numfds = 0;
92053a
@@ -1136,11 +1138,13 @@ snmp_sess_synch_response(void *sessp,
92053a
     ss->callback = snmp_synch_input;
92053a
     ss->callback_magic = (void *) state;
92053a
 
92053a
-    if ((state->reqid = snmp_sess_send(sessp, pdu)) == 0) {
92053a
+    if (snmp_sess_send(sessp, pdu) == 0) {
92053a
         snmp_free_pdu(pdu);
92053a
         state->status = STAT_ERROR;
92053a
-    } else
92053a
+    } else {
92053a
+	state->reqid = pdu->reqid;
92053a
         state->waiting = 1;
92053a
+    }
92053a
 
92053a
     while (state->waiting) {
92053a
         numfds = 0;
92053a