On November 18, 2010 01:48, Nicholas Clark wrote: > > + struct xpvhv_aux * const newaux = hv_auxinit(hv); > > ^^^^^^^^^ > That leaks in some cases. I'm not sure what the correct fix should be. (Sorry) I’ve looked at it half a dozen times, and I cannot see how it is leaking. The auxiliary structure is allocated as part of the same memory block as HvARRAY. That gets freed either at the end of the loop body or, if the loop exits early, at the end of the function (hfreeentries). That commit *did* introduce a memory leak. It was leaking a HEK. But that was fixed a few commits later. There have been more changes since then. Does it leak in current blead? Does valgrind always tell the truth?