mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-06 04:06:34 -05:00
coverity fixes
This commit is contained in:
parent
0f4f48d377
commit
df20aa2a1e
5 changed files with 8 additions and 3 deletions
|
|
@ -411,7 +411,7 @@ int snd_ctl_elem_add_enumerated(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id,
|
|||
bytes = 0;
|
||||
for (i = 0; i < items; ++i)
|
||||
bytes += strlen(names[i]) + 1;
|
||||
buf = malloc(bytes);
|
||||
buf = bytes ? malloc(bytes) : NULL;
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
info->value.enumerated.names_ptr = (uintptr_t)buf;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue