mirror of
https://github.com/apache/nuttx.git
synced 2026-10-03 20:27:53 +00:00
libc/elf: Free the registry entry when removing a module.
libelf_remove() takes the module out of the registry but never frees
the registry entry, so every successful rmmod()/dlclose() leaks
sizeof(struct module_s), the name included. The lib_free() call was
dropped by e9550783d3 when the removal path was reworked.
Free the entry after the registry lock is released.
Assisted-by: OpenAI Codex
Signed-off-by: yushuailong <yyyusl@qq.com>
This commit is contained in:
parent
7c02367483
commit
a9683532b5
1 changed files with 2 additions and 0 deletions
|
|
@ -240,6 +240,8 @@ int libelf_remove(FAR void *handle)
|
|||
|
||||
/* And free the registry entry */
|
||||
|
||||
lib_free(modp);
|
||||
|
||||
return ret;
|
||||
|
||||
errout_with_lock:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue