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

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