• Guido Casati's avatar
    Fix memory leak in RCconfig_nr_parallel · 6e7ea5ce
    Guido Casati authored
    * strdup() function is returning a malloced string
      which must be freed after use
    * replace the strdup with direct use of strings to avoid heap allocation
    
    > Direct leak of 23 byte(s) in 1 object(s) allocated from:
        > 0 0x7ffff745b9a7 in __interceptor_strdup ../../../../src/libsanitizer/asan/asan_interceptors.cpp:454
        > 1 0x555559e36f87 in RCconfig_nr_parallel /openair2/GNB_APP/gnb_config.c:2054
        > 2 0x555559e38ea3 in NRRCConfig /openair2/GNB_APP/gnb_config.c:2097
        > 3 0x555559155542 in get_options /executables/nr-softmodem.c:423
        > 4 0x555559155542 in main /executables/nr-softmodem.c:623
        > 5 0x7ffff5e29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    
    > Direct leak of 14 byte(s) in 1 object(s) allocated from:
        > 0 0x7ffff745b9a7 in __interceptor_strdup ../../../../src/libsanitizer/asan/asan_interceptors.cpp:454
        > 1 0x555559e370c5 in RCconfig_nr_parallel /openair2/GNB_APP/gnb_config.c:2063
        > 2 0x555559e38ea3 in NRRCConfig /openair2/GNB_APP/gnb_config.c:2097
        > 3 0x555559155542 in get_options /executables/nr-softmodem.c:423
        > 4 0x555559155542 in main /executables/nr-softmodem.c:623
        > 5 0x7ffff5e29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    6e7ea5ce
gnb_config.c 133 KB