Merge pull request #1385 from rubenk/gcrypt-fix
authorRuben Kerkhof <ruben@tilaa.nl>
Sun, 29 Nov 2015 18:04:54 +0000 (19:04 +0100)
committerRuben Kerkhof <ruben@tilaa.nl>
Sun, 29 Nov 2015 18:04:54 +0000 (19:04 +0100)
configure.ac: remove wrong gcrypt check

src/fhcount.c
src/filecount.c
src/irq.c
src/modbus.c

index 4c409b5..666dacc 100644 (file)
@@ -98,6 +98,7 @@ static int fhcount_read(void) {
   }
   if (fgets(buffer, buffer_len, fp) == NULL) {
     ERROR("fhcount: fgets: %s", sstrerror(errno, errbuf, sizeof(errbuf)));
+    fclose(fp);
     return(EXIT_FAILURE);
   }
   fclose(fp);
index 47caf93..9ea8af7 100644 (file)
@@ -356,6 +356,7 @@ static int fc_config_add_dir (oconfig_item_t *ci)
   if (dir->path == NULL)
   {
     ERROR ("filecount plugin: strdup failed.");
+    sfree (dir);
     return (-1);
   }
 
index 6afacf0..93f3f53 100644 (file)
--- a/src/irq.c
+++ b/src/irq.c
@@ -120,6 +120,7 @@ static int irq_read (void)
        } else {
                ERROR ("irq plugin: unable to get CPU count from first line "
                                "of /proc/interrupts");
+               fclose (fh);
                return (-1);
        }
 
index cfc6331..d2b0a53 100644 (file)
@@ -942,9 +942,15 @@ static int mb_config_add_host (oconfig_item_t *ci) /* {{{ */
 
   status = cf_util_get_string_buffer (ci, host->host, sizeof (host->host));
   if (status != 0)
+  {
+    sfree (host);
     return (status);
+  }
   if (host->host[0] == 0)
+  {
+    sfree (host);
     return (EINVAL);
+  }
 
   for (i = 0; i < ci->children_num; i++)
   {