Upon further analysis, I conclude that the patch submitted with in this bug report is functionally identical to the patch submitted in ticket #3924. Both patches are against a common ancestor, and both patches resolve the double-free issue without creating a memory leak.