Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33298 )
Change subject: lib: Prevent memory leak on error path ......................................................................
Patch Set 1: Code-Review+2
Not objecting to this patch specifically, but note that free() is currently a no-op in coreboot and even if we added a real allocator we'd probably never get into a situation where a leak like this matters (since coreboot isn't really a program that persists and runs stuff repeatedly... it boots once, finds a payload, tries to load that and if it fails it hangs -- if we run into the error path here, it's unlikely we'll ever need to allocate anything again).
So I'm fine with adding free() in simple cases like this but the DT/FIT code leaks plenty more memory elsewhere where it would be much more complicated to correctly free it all up again in all cases, and I don't think we should add complex code to cover those cases.