How to solve process control

I'm working on below process control issue reported by fortify which is described in https://vulncat.fortify.com/en/detail?id=desc.dataflow.abap.process_control#C%2FC%2B%2B.
The function load() in filename.c calls dlopen() on line 3. The call loads a library without specifying an absolute path. It could result in the program using a malicious library supplied by an attacker.

I have below function which is getting invoked in different places of code.

void* load(char* name)
{
    void* handle;
    handle = dlopen(name, RTLD_LAZY | RTLD_GLOBAL);
    return(handle);
}

void somefunc()
{
    void *login_module_handle = load("/home/myuser/load_this_shared_lib.so");
}

Here I'm already using absolute path, but don't understand why Fortify still reports the error.

The possible recommendation from Fortify is as shown below.

  1. Whenever possible, libraries should be controlled by the application and executed using an absolute path.
  2. In cases where the path is not known at compile time, such as for cross-platform applications, an absolute path should be constructed from known values during execution.

As per the suggestion, I modified the code as shown below but it didn't solve the problem.
void somefunc()
{
    void *login_module_handle = dlopen("/home/myuser/load_this_shared_lib.so",RTLD_LAZY | RTLD_GLOBAL);
}
 

Any suggestion would be helpful.