[PATCH 1/2] memblock: fix memory leak when pa_shm_create_rw fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Lu Guanqun <guanqun.lu at intel.com>
---
 src/pulsecore/memblock.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/pulsecore/memblock.c b/src/pulsecore/memblock.c
index e34a739..332fcb7 100644
--- a/src/pulsecore/memblock.c
+++ b/src/pulsecore/memblock.c
@@ -728,6 +728,8 @@ pa_mempool* pa_mempool_new(pa_bool_t shared, size_t size) {
     }
 
     if (pa_shm_create_rw(&p->memory, p->n_blocks * p->block_size, shared, 0700) < 0) {
+        pa_semaphore_free(p->semaphore);
+        pa_mutex_free(p->mutex);
         pa_xfree(p);
         return NULL;
     }



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux