Commit d55e13d4 authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

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: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 1bd799ef
...@@ -97,8 +97,10 @@ static int collect_filter_for_pstree(struct pstree_item *item) ...@@ -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.len = len * sizeof(struct sock_filter);
info->filter.filter.data = xmalloc(info->filter.filter.len); info->filter.filter.data = xmalloc(info->filter.filter.len);
if (!info->filter.filter.data) if (!info->filter.filter.data) {
xfree(info);
goto out; goto out;
}
memcpy(info->filter.filter.data, buf, info->filter.filter.len); memcpy(info->filter.filter.data, buf, info->filter.filter.len);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment