Fix shlib loaded: free memory, handle lib reload

- introduce loader_reset() that frees all memory
- resolve memory leak in loader_format_shlibpath()
- correctly handle library reload: check if a function has been
  retrieved already. Don't leak memory (strdup()), and handle multiple
  reloads of different functions from the same SO
This commit is contained in:
Robert Schmidt
2022-02-21 13:34:40 +01:00
parent 923edebd3c
commit ac0af5a84e
3 changed files with 58 additions and 18 deletions
+3
View File
@@ -29,6 +29,7 @@
#include "common/config/config_userapi.h"
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "common/utils/load_module_shlib.h"
#include "T.h"
#include "PHY/defs_gNB.h"
#include "PHY/defs_nr_common.h"
@@ -671,6 +672,8 @@ int main(int argc, char **argv)
if (ouput_vcd)
vcd_signal_dumper_close();
loader_reset();
return (n_errors);
}