diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-02-11 14:56:26 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-02-11 14:56:26 +0000 |
commit | ecfc30551bebb4e5c8db8336eda143f53c020e10 (patch) | |
tree | 5e75432502d571d32368ce8f734a5e9308f06399 /plugins/omsnmp | |
parent | ad55b12ac9e9162c2fff77072ab3d56e4637c788 (diff) | |
download | rsyslog-ecfc30551bebb4e5c8db8336eda143f53c020e10.tar.gz rsyslog-ecfc30551bebb4e5c8db8336eda143f53c020e10.tar.xz rsyslog-ecfc30551bebb4e5c8db8336eda143f53c020e10.zip |
a bit more rsyslog-like
Diffstat (limited to 'plugins/omsnmp')
-rw-r--r-- | plugins/omsnmp/omsnmp.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/plugins/omsnmp/omsnmp.c b/plugins/omsnmp/omsnmp.c index c559dbc8..f31f071f 100644 --- a/plugins/omsnmp/omsnmp.c +++ b/plugins/omsnmp/omsnmp.c @@ -247,16 +247,14 @@ static rsRetVal omsnmp_sendsnmp(instanceData *pData, uchar *psz) /* Debug Output! */ logerrorVar( "omsnmp_sendsnmp: snmp_send failed error '%d', Description='%s'\n", iErrorCode*(-1), api_errors[iErrorCode*(-1)]); - /* TODO! CLEANUP */ ABORT_FINALIZE(RS_RET_ERR); } - else /* Reset pdu Pointer, already cleaned */ - pdu = NULL; finalize_it: - if(pdu != NULL) { - snmp_free_pdu(pdu); - dbgprintf( "omsnmp_sendsnmp: called snmp_free_pdu - manually freeing memory for pdu\n"); + if(iRet != RS_RET_OK) { + if(pdu != NULL) { + snmp_free_pdu(pdu); + } } if(ss != NULL) { @@ -278,11 +276,6 @@ CODESTARTdoAction /* dbgprintf("omsnmp: Sending SNMP Trap to '%s' on Port '%d'\n", pData->szTarget, pData->iPort); */ iRet = omsnmp_sendsnmp(pData, ppString[0]); - if (iRet == RS_RET_ERR) - { - /* TODO: CLEANUP! */ - ABORT_FINALIZE(RS_RET_SUSPENDED); - } finalize_it: ENDdoAction |