Code

csv plugin: plug memory leak on error
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 28 Nov 2015 19:19:26 +0000 (20:19 +0100)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 28 Nov 2015 19:20:52 +0000 (20:20 +0100)
CID 38015

src/csv.c

index 15494f450dd60a852be2b948c8356c781194c2e1..d2d388bc9600a97d6359ab60621b9672325b1277 100644 (file)
--- a/src/csv.c
+++ b/src/csv.c
@@ -64,7 +64,10 @@ static int value_list_to_string (char *buffer, int buffer_len,
                                && (ds->ds[i].type != DS_TYPE_GAUGE)
                                && (ds->ds[i].type != DS_TYPE_DERIVE)
                                && (ds->ds[i].type != DS_TYPE_ABSOLUTE))
+               {
+                       sfree (rates);
                        return (-1);
+               }
 
                if (ds->ds[i].type == DS_TYPE_GAUGE) 
                {