processes.c: plug memory leak in error path
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Fri, 27 Nov 2015 21:00:10 +0000 (22:00 +0100)
committerFlorian Forster <octo@collectd.org>
Sat, 28 Nov 2015 06:38:41 +0000 (07:38 +0100)
Found with Infer (http://fbinfer.com/)

Signed-off-by: Florian Forster <octo@collectd.org>
src/processes.c

index 516104f..bcc4ad5 100644 (file)
@@ -276,6 +276,7 @@ static void ps_list_register (const char *name, const char *regexp)
                {
                        DEBUG ("ProcessMatch: compiling the regular expression \"%s\" failed.", regexp);
                        sfree(new->re);
+                       sfree(new);
                        return;
                }
        }