From a2785882aa50b5a8d7ff2a5f59a5eb995ad7491e Mon Sep 17 00:00:00 2001 From: Andre Lorbach Date: Mon, 11 Feb 2008 09:54:20 +0000 Subject: Added missing variable checks in modExit and CODESTARTmodExit --- plugins/omsnmp/omsnmp.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'plugins/omsnmp') diff --git a/plugins/omsnmp/omsnmp.c b/plugins/omsnmp/omsnmp.c index 42b50433..2dce5791 100644 --- a/plugins/omsnmp/omsnmp.c +++ b/plugins/omsnmp/omsnmp.c @@ -450,7 +450,23 @@ static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __a if (pszTarget != NULL) free(pszTarget); pszTarget = NULL; + + if (pszCommunity != NULL) + free(pszCommunity); + pszCommunity = NULL; + + if (pszEnterpriseOID != NULL) + free(pszEnterpriseOID); + pszEnterpriseOID = NULL; + + if (pszSyslogMessageOID != NULL) + free(pszSyslogMessageOID); + pszSyslogMessageOID = NULL; + iPort = 0; + iSNMPVersion = 1; + iSpecificType = 0; + iTrapType = SNMP_TRAP_ENTERPRISESPECIFIC; return RS_RET_OK; } @@ -460,6 +476,12 @@ BEGINmodExit CODESTARTmodExit if (pszTarget != NULL) free(pszTarget); +if (pszCommunity != NULL) + free(pszCommunity); +if (pszEnterpriseOID != NULL) + free(pszEnterpriseOID); +if (pszSyslogMessageOID != NULL) + free(pszSyslogMessageOID); ENDmodExit -- cgit