Citeren Felix Fietkau <[email protected]>:

On 2016-12-18 02:22, Rosen Penev wrote:
Thread safe replacement.

Signed-off by: Rosen Penev <[email protected]>
For ubox this change isn't really necessary. There's no thread safety
issues, or issues with use of strtok by callers.

I have my doubts about using strsep() on dynamically allocated buffers. In the scan_loaded_modules function of kmodloader.c, you'll lose the pointer to buf so you can't free the memory that was allocated by getline. Great, the function is now thread safe, but we've got a memory leak instead.

I would suggest to use strtok_r in cases where thread safety is an issue, rather than replacing it with strsep.


_______________________________________________
Lede-dev mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/lede-dev

Reply via email to