Looks like someone already got to some of the changes. However, those changes diverge just enough from Core than a straight backport breaks things. Starting to read up about Core Foundation, now.
It does looks like @CCulianu 's patch and the patch you backport where intended to fix the same issue. The mix of both that you are proposing here makes zero sense.
|830 ↗||(On Diff #8365)|
Here this is retained.
|855 ↗||(On Diff #8365)|
To be almost immediately freed in what appears to be the only callsite.