mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
memblock: fix memory leak when pa_shm_create_rw fails
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
This commit is contained in:
parent
a1ce2426d8
commit
ecbb4b4ef4
1 changed files with 3 additions and 3 deletions
|
|
@ -711,9 +711,6 @@ pa_mempool* pa_mempool_new(pa_bool_t shared, size_t size) {
|
|||
|
||||
p = pa_xnew(pa_mempool, 1);
|
||||
|
||||
p->mutex = pa_mutex_new(TRUE, TRUE);
|
||||
p->semaphore = pa_semaphore_new(0);
|
||||
|
||||
p->block_size = PA_PAGE_ALIGN(PA_MEMPOOL_SLOT_SIZE);
|
||||
if (p->block_size < PA_PAGE_SIZE)
|
||||
p->block_size = PA_PAGE_SIZE;
|
||||
|
|
@ -745,6 +742,9 @@ pa_mempool* pa_mempool_new(pa_bool_t shared, size_t size) {
|
|||
PA_LLIST_HEAD_INIT(pa_memimport, p->imports);
|
||||
PA_LLIST_HEAD_INIT(pa_memexport, p->exports);
|
||||
|
||||
p->mutex = pa_mutex_new(TRUE, TRUE);
|
||||
p->semaphore = pa_semaphore_new(0);
|
||||
|
||||
p->free_slots = pa_flist_new(p->n_blocks);
|
||||
|
||||
return p;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue