From ecfc30551bebb4e5c8db8336eda143f53c020e10 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 11 Feb 2008 14:56:26 +0000 Subject: a bit more rsyslog-like --- plugins/omsnmp/omsnmp.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'plugins') 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 -- cgit