On 7/7/2016 2:27 PM, Marvin H?user wrote:
I don't think these strings can ever be statically allocated. If pointers to
stack variables were used, the strings would be theoretically invalid the
moment the exposing function returns. Furthermore they can't be part oft he
struct itself as that would change the offsets of all other members after the
string. Hence I think it can be concluded they are always dynamically allocated.
And as one can be sure they are dynamically allocated, I think it's the task of
the function that uninstalls the protocol to free the two buffers. Should the
protocol not be uninstalled till ExitBootServices(), it doesn't matter either
because the OS loader may treat Boot Services code and data as free space.
Did I miss something?
They could be globals. The problem is that the memory leak occurs every
time a FMP client calls the GetImageInfo function, and since UEFI scales
down to small embedded systems (e.g. it runs on my credit card-sized
HiKey board), that's a bad thing. Elsewhere in the spec I see it called
out who's responsible for memory management, so either I'm missing
something or there was a mistake in this place.
--
Bruce
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel