openvpn: free resource on error
[collectd.git] / src / openvpn.c
index 9291a16..65440d5 100644 (file)
@@ -622,6 +622,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 +633,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);