docs: Add info about mode7 requirement for ntpd
[collectd.git] / src / openvpn.c
index 9291a16..5060425 100644 (file)
@@ -459,6 +459,8 @@ static int openvpn_read (void)
        /* call the right read function for every status entry in the list */
        for (i = 0; i < vpn_num; i++)
        {
+               int vpn_read = 0;
+
                fh = fopen (vpn_list[i]->file, "r");
                if (fh == NULL)
                {
@@ -622,6 +624,7 @@ static int openvpn_config (const char *key, const char *value)
                        char errbuf[1024];
                        ERROR ("openvpn plugin: malloc failed: %s",
                                        sstrerror (errno, errbuf, sizeof (errbuf)));
+                       sfree (status_file);
                        return (1);
                }
                temp->file = status_file;
@@ -632,7 +635,7 @@ static int openvpn_config (const char *key, const char *value)
                if (vpn_list == NULL)
                {
                        char errbuf[1024];
-                       ERROR ("openvpn plugin: malloc failed: %s",
+                       ERROR ("openvpn plugin: realloc failed: %s",
                                        sstrerror (errno, errbuf, sizeof (errbuf)));
 
                        sfree (temp->file);