I've noticed more leaks reading the code, but I couldn't check them with valgrind, because I don't know how to trigger that code path. I'll just clean up the file using smart pointer everywhere.
Created attachment 328289 [details] Patch
Committed r225473: <https://trac.webkit.org/changeset/225473>
<rdar://problem/35825070>