Code

Plug a memory leak in disk plugin
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 4 Jun 2016 20:15:15 +0000 (22:15 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 4 Jun 2016 20:15:15 +0000 (22:15 +0200)
Introduced by bdbc066 so no need to backport.
CID 116311

src/disk.c

index 255d4db6076d905210e7fd1628217c05bcaf6db1..292f6e29cf4d06959cd4c799b97a3eadac3dafa4 100644 (file)
@@ -893,7 +893,13 @@ static int disk_read (void)
 #endif
 
                if (ignorelist_match (ignorelist, output_name) != 0)
+               {
+#if HAVE_LIBUDEV
+                       /* release udev-based alternate name, if allocated */
+                       sfree (output_name);
+#endif
                        continue;
+               }
 
                if ((ds->read_bytes != 0) || (ds->write_bytes != 0))
                        disk_submit (output_name, "disk_octets",