The return value of "list_devices()" is declared to be a reference variable while "inets" is not. In the case, inets will construct a new object which has different address. and the object pointed by list_wd gets no chance to be freed, which leads to heap memory leak.
First thanks for developing this tool, which is quite helpful.
We found a memory leak issue during test.
function "list_devices()" is defined as following
The return value of "list_devices()" is declared to be a reference variable while "inets" is not. In the case, inets will construct a new object which has different address. and the object pointed by list_wd gets no chance to be freed, which leads to heap memory leak.
Propose fix as following:
Or change "list_devices()" to return the pointer instead.