Parent: 20a0255b9e5fc40868dae916940601a0eaa64dc8
Author: Bastien Nocera <hadess@hadess.net>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2024-05-16 23:37:50
Tree: bd91f917dc814fa8cb036e439d9ed8785e4c49bb
shared/bap: Fix memory leak in error path Error: RESOURCE_LEAK (CWE-772): [#def38] [important] src/shared/bap.c:6066:27: alloc_fn: Storage is returned from allocation function "util_malloc". src/shared/bap.c:6066:27: var_assign: Assigning: "__p" = storage returned from "util_malloc(__n * __s)". src/shared/bap.c:6066:27: noescape: Resource "__p" is not freed or pointed-to in "memset". [Note: The source code implementation of the function has been overridden by a builtin model.] src/shared/bap.c:6066:27: leaked_storage: Variable "__p" going out of scope leaks the storage it points to. src/shared/bap.c:6066:2: var_assign: Assigning: "base_iov" = "({...; __p;})". src/shared/bap.c:6070:2: noescape: Resource "base_iov" is not freed or pointed-to in "util_iov_push_le24". src/shared/bap.c:6071:3: leaked_storage: Variable "base_iov" going out of scope leaks the storage it points to. 6069| 6070| if (!util_iov_push_le24(base_iov, base->pres_delay)) 6071|-> return NULL; 6072| 6073| if (!util_iov_push_u8(base_iov, Error: RESOURCE_LEAK (CWE-772): [#def39] [important] src/shared/bap.c:6066:27: alloc_fn: Storage is returned from allocation function "util_malloc". src/shared/bap.c:6066:27: var_assign: Assigning: "__p" = storage returned from "util_malloc(__n * __s)". src/shared/bap.c:6066:27: noescape: Resource "__p" is not freed or pointed-to in "memset". [Note: The source code implementation of the function has been overridden by a builtin model.] src/shared/bap.c:6066:27: leaked_storage: Variable "__p" going out of scope leaks the storage it points to. src/shared/bap.c:6066:2: var_assign: Assigning: "base_iov" = "({...; __p;})". src/shared/bap.c:6070:2: noescape: Resource "base_iov" is not freed or pointed-to in "util_iov_push_le24". src/shared/bap.c:6073:2: noescape: Resource "base_iov" is not freed or pointed-to in "util_iov_push_u8". src/shared/bap.c:6075:3: leaked_storage: Variable "base_iov" going out of scope leaks the storage it points to. 6073| if (!util_iov_push_u8(base_iov, 6074| queue_length(base->subgroups))) 6075|-> return NULL; 6076| 6077| queue_foreach(base->subgroups, generate_subgroup_base,
Diffstat
| M | src/shared/bap.c | | | 10 | ++++++++- - |
1 files changed, 8 insertions(+), 2 deletions(-)