On Wed, May 28, 2014 at 9:18 AM, Plüm, Rüdiger, Vodafone Group <[email protected]> wrote: > > >> -----Original Message----- >> From: Yann Ylavic [mailto:[email protected]] >> 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 <[email protected]> >> 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.
