Florian Forster ha scritto:
Hi Marco,

Hi Florian,

I'm too tired to have a look at this now, I hope to have some time in
the next few days. I'll come back to you asap.

That's fine :)
But sorry, I forgot to recheck a small part of the code after adding and moving some stuff around, please apply this patch too.

Regards,
Marco

--- openvpn.name.c	2009-09-20 10:04:37.000000000 +0200
+++ openvpn.c	2009-09-20 10:04:37.000000000 +0200
@@ -491,12 +491,14 @@ static int openvpn_config (const char *k
 				{
 					WARNING ("status filename \"%s\" already used, \
 						please choose a different one.", status_name);
+
+					sfree (status_file);
 					return (1);
 				}
 			}
 		}
 
-		/* create a new vpn element since file and version are ok */	
+		/* create a new vpn element since file, version and name are ok */	
 		temp = (vpn_status_t *) malloc (sizeof (vpn_status_t));
 		temp->file = status_file;
 		temp->version = status_version;
@@ -505,10 +507,13 @@ static int openvpn_config (const char *k
 		vpn_list = (vpn_status_t **) realloc (vpn_list, (vpn_num + 1) * sizeof (vpn_status_t *));
 		if (vpn_list == NULL)
 		{
-		    char errbuf[1024];
-		    ERROR ("openvpn plugin: malloc failed: %s",
-			    sstrerror (errno, errbuf, sizeof (errbuf)));
-		    return (1);
+			char errbuf[1024];
+			ERROR ("openvpn plugin: malloc failed: %s",
+				sstrerror (errno, errbuf, sizeof (errbuf)));
+
+			sfree (temp->file);
+			sfree (temp);
+			return (1);
 		}
 
 		vpn_list[vpn_num] = temp;
_______________________________________________
collectd mailing list
[email protected]
http://mailman.verplant.org/listinfo/collectd

Reply via email to