According to other code I've seen this is never done by anyone else, so this
must mean that the snmp library takes care of this somehow. Man, I love well
documented libraries!
res = NULL;
status = snmp_sess_synch_response (host->sess_handle, req, &res);
- if (req != NULL)
- snmp_free_pdu (req);
- req = NULL;
-
if ((status != STAT_SUCCESS) || (res == NULL))
{
char *errstr = NULL;
ERROR ("snmp plugin: host %s: snmp_sess_synch_response failed: %s",
host->name, (errstr == NULL) ? "Unknown problem" : errstr);
- if (req != NULL)
- snmp_free_pdu (req);
- req = NULL;
-
if (res != NULL)
snmp_free_pdu (res);
res = NULL;
vl.values[i] = csnmp_value_list_to_value (vb, ds->ds[i].type);
} /* for (res->variables) */
- if (req != NULL)
- snmp_free_pdu (req);
- req = NULL;
-
if (res != NULL)
snmp_free_pdu (res);
res = NULL;