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

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