cg: Fix use-after-free in put_ctls

Since we're freeing list entries don't forget to
initialize list then, otherwise it gets out with
free entries and may hit use-after-free bug.

Signed-off-by: Cyrill Gorcunov <gorcunov@virtuozzo.com>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
Cyrill Gorcunov 2016-03-31 17:39:43 +03:00 committed by Pavel Emelyanov
parent c553fe04f4
commit 94bfda900e

View file

@ -2302,6 +2302,7 @@ void put_ctls(struct list_head *l)
xfree(c->path);
xfree(c);
}
INIT_LIST_HEAD(l);
}
/* Parse and create all the real controllers. This does not include things with