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

Lu Guanqun guanqun.lu at intel.com
Mon Aug 15 01:03:44 PDT 2011


On Mon, Aug 15, 2011 at 03:36:51PM +0800, Maarten Bosmans wrote:
> Good catch!
> 
> An alternative solution (and IMHO better one) would be to move the two
> lines allocating the mutex and semaphore below the if-block that can
> return. That way you avoid the memory-leak situation alltogether.

Thanks for the suggestion, I decided to move it a bit lower because
lines around the if statement are all about blocks related. ;)

Please see the attachment.

-- 
guanqun


More information about the pulseaudio-discuss mailing list