Re: malloc, free, strdup and kernel builds

2022-09-22 Thread Mark Stevens
Thanks you for taking the time to respond. I think I will look at providing kmm_strdup and submit a PR with the fix. It will probably be safer to do this and reduce the possibly of disturbing existing code with changes to the definition of free. Regards, Mark _ Blog

Re: malloc, free, strdup and kernel builds

2022-09-21 Thread Gregory Nutt
This does not seem like a technical issue but rather awkward usage/naming that is prone to misuse. Yes, free() should be called to release the memory allocated by strdup. But applications cannot use the kernel heap and, for reasons of protection, the kernel should not store anything in the use