mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
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:
parent
1bd799ef30
commit
d55e13d4f3
1 changed files with 3 additions and 1 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue