seccomp: don't leak info on an error path

CID 154852 (#1 of 3): Resource leak (RESOURCE_LEAK)
32. leaked_storage: Variable info going out of scope leaks the storage it points to.

Reported-by: coverity
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrew Vagin 2015-11-26 09:13:00 +03:00 committed by Pavel Emelyanov
parent 1bd799ef30
commit d55e13d4f3

View file

@ -97,8 +97,10 @@ static int collect_filter_for_pstree(struct pstree_item *item)
info->filter.filter.len = len * sizeof(struct sock_filter);
info->filter.filter.data = xmalloc(info->filter.filter.len);
if (!info->filter.filter.data)
if (!info->filter.filter.data) {
xfree(info);
goto out;
}
memcpy(info->filter.filter.data, buf, info->filter.filter.len);