Blame SOURCES/net-snmp-5.8-coverity.patch

700982
diff -urNp a/agent/mibgroup/disman/event/mteTrigger.c b/agent/mibgroup/disman/event/mteTrigger.c
700982
--- a/agent/mibgroup/disman/event/mteTrigger.c	2018-09-27 10:43:38.722444233 +0200
700982
+++ b/agent/mibgroup/disman/event/mteTrigger.c	2018-09-27 11:01:46.503253963 +0200
700982
@@ -1012,7 +1012,7 @@ mteTrigger_run( unsigned int reg, void *
700982
                      * Similarly, if no fallEvent is configured,
700982
                      *  there's no point in trying to fire it either.
700982
                      */
700982
-                    if (entry->mteTThRiseEvent[0] != '\0' ) {
700982
+                    if (entry->mteTThFallEvent[0] != '\0' ) {
700982
                         entry->mteTriggerXOwner   = entry->mteTThObjOwner;
700982
                         entry->mteTriggerXObjects = entry->mteTThObjects;
700982
                         entry->mteTriggerFired    = vp1;
700982
@@ -1105,7 +1105,7 @@ mteTrigger_run( unsigned int reg, void *
700982
                      * Similarly, if no fallEvent is configured,
700982
                      *  there's no point in trying to fire it either.
700982
                      */
700982
-                    if (entry->mteTThDRiseEvent[0] != '\0' ) {
700982
+                    if (entry->mteTThDFallEvent[0] != '\0' ) {
700982
                         entry->mteTriggerXOwner   = entry->mteTThObjOwner;
700982
                         entry->mteTriggerXObjects = entry->mteTThObjects;
700982
                         entry->mteTriggerFired    = vp1;
700982
diff -urNp a/agent/mibgroup/hardware/cpu/cpu_linux.c b/agent/mibgroup/hardware/cpu/cpu_linux.c
700982
--- a/agent/mibgroup/hardware/cpu/cpu_linux.c	2018-09-27 10:43:38.697444449 +0200
700982
+++ b/agent/mibgroup/hardware/cpu/cpu_linux.c	2018-09-27 11:12:07.109024625 +0200
700982
@@ -122,6 +122,7 @@ int netsnmp_cpu_arch_load( netsnmp_cache
700982
         bsize = getpagesize()-1;
700982
         buff = (char*)malloc(bsize+1);
700982
         if (buff == NULL) {
700982
+            close(statfd);
700982
             return -1;
700982
         }
700982
     }
700982
diff -urNp a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
700982
--- a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c	2018-09-27 10:43:38.711444328 +0200
700982
+++ b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c	2018-09-27 11:16:45.532231535 +0200
700982
@@ -543,15 +543,18 @@ netsnmp_access_ipaddress_extra_prefix_in
700982
     status = send (sd, &req, req.nlhdr.nlmsg_len, 0);
700982
     if (status < 0) {
700982
         snmp_log(LOG_ERR, "could not send netlink request\n");
700982
+        close(sd);
700982
         return -1;
700982
     }
700982
     status = recv (sd, buf, sizeof(buf), 0);
700982
     if (status < 0) {
700982
         snmp_log (LOG_ERR, "could not recieve netlink request\n");
700982
+        close(sd);
700982
         return -1;
700982
     }
700982
     if (status == 0) {
700982
        snmp_log (LOG_ERR, "nothing to read\n");
700982
+       close(sd);
700982
        return -1;
700982
     }
700982
     for (nlmp = (struct nlmsghdr *)buf; status > sizeof(*nlmp); ){
700982
@@ -561,11 +564,13 @@ netsnmp_access_ipaddress_extra_prefix_in
700982
 
700982
         if (req_len < 0 || len > status) {
700982
             snmp_log (LOG_ERR, "invalid netlink message\n");
700982
+            close(sd);
700982
             return -1;
700982
         }
700982
 
700982
         if (!NLMSG_OK (nlmp, status)) {
700982
             snmp_log (LOG_ERR, "invalid NLMSG message\n");
700982
+            close(sd);
700982
             return -1;
700982
         }
700982
         rtmp = (struct ifaddrmsg *)NLMSG_DATA(nlmp);