mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
stream: add missing out of memory check
The return value of calloc() was not checked for NULL.
This commit is contained in:
parent
babcf6d118
commit
8eac31baff
1 changed files with 2 additions and 0 deletions
|
|
@ -1256,6 +1256,8 @@ static int node_event_param(void *object, int seq,
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
c = calloc(1, sizeof(*c) + SPA_POD_SIZE(param));
|
c = calloc(1, sizeof(*c) + SPA_POD_SIZE(param));
|
||||||
|
if (c == NULL)
|
||||||
|
return -ENOMEM;
|
||||||
c->info = SPA_PTROFF(c, sizeof(*c), struct spa_pod);
|
c->info = SPA_PTROFF(c, sizeof(*c), struct spa_pod);
|
||||||
memcpy(c->info, param, SPA_POD_SIZE(param));
|
memcpy(c->info, param, SPA_POD_SIZE(param));
|
||||||
c->control.n_values = 0;
|
c->control.n_values = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue