mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-31 22:25:33 -04:00
srbchannel: Check return value of pa_memblock_new_pool
In case PA_MEMPOOL_DISABLE is set, pa_memblock_new_pool can return NULL. It does not make sense to set up a srbchannel without a shared memory pool, so just fail in this case. Reported-by: Alexander Patrakov <patrakov@gmail.com> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
parent
ce7ff172b8
commit
e175796fa5
1 changed files with 3 additions and 0 deletions
|
|
@ -231,6 +231,9 @@ pa_srbchannel* pa_srbchannel_new(pa_mainloop_api *m, pa_mempool *p) {
|
|||
pa_srbchannel* sr = pa_xmalloc0(sizeof(pa_srbchannel));
|
||||
sr->mainloop = m;
|
||||
sr->memblock = pa_memblock_new_pool(p, -1);
|
||||
if (!sr->memblock)
|
||||
goto fail;
|
||||
|
||||
srh = pa_memblock_acquire(sr->memblock);
|
||||
pa_zero(*srh);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue