It affects v3-3-test and higher versions.
Created attachment 4879 [details]
patch for v3-3-test
Created attachment 4880 [details]
patch for v3-4-test
+1 from me. These are valid fixes for referencing free memory (and memory leaks).
Re-assigning to Karolin for inclusion in 3.3.10 and 3.4.4 (this isn't a show stopper for 3.4.3 IMHO).
Pushed to v3-3-test and v3-4-test.
Closing out bug report.