httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yann Ylavic <ylavic....@gmail.com>
Subject Re: Memory leak in mod_ssl ssl_callback_TmpDH
Date Wed, 28 May 2014 10:37:34 GMT
On Wed, May 28, 2014 at 9:18 AM, Plüm, Rüdiger, Vodafone Group
<ruediger.pluem@vodafone.com> wrote:
>
>
>> -----Original Message-----
>> From: Yann Ylavic [mailto:ylavic.dev@gmail.com]
>> Sent: Mittwoch, 28. Mai 2014 01:25
>> To: httpd
>> Subject: Re: Memory leak in mod_ssl ssl_callback_TmpDH
>>
>> On Tue, May 27, 2014 at 10:33 PM, Ruediger Pluem <rpluem@apache.org>
>> wrote:
>> >
>> >  #define make_get_dh(rfc,size,gen) \
>> >  static DH *get_dh##size(void) \
>> > @@ -1339,7 +1344,7 @@
>> >          DH_free(dh_tmp); \
>> >          return NULL; \
>> >      } \
>> > -    dh = dh_tmp; \
>> > +    apr_atomic_xchgptr((volatile void **)&dh, dh_tmp); \
>> >      return dh; \
>> >  }
>> >
>>
>> I think you still need to handle the race (leak) with something like :
>
> To be honest I am not worried about the leak as it is very limited and does not harm.

Well, "fixing" it does not harm too much either (and quiets valgrind a
bit, this has potential #cores leaks).
We probably need an #include "apr_atomic.h" at the top too...

Regards.

Mime
View raw message