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

Colin Guthrie gmane at colin.guthr.ie
Mon Aug 15 01:40:44 PDT 2011


'Twas brillig, and Lu Guanqun at 15/08/11 09:03 did gyre and gimble:
> 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.

Cool. Thanks. In my tree now.

Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]



More information about the pulseaudio-discuss mailing list