NK_read_config returns a pointer to an array that is allocated using new[] (in duplicate_vector_and_clear), so it should be deleted using delete[]. But the user of the C API typically will only have access to free, which should not be used in this case (see e. g. the ISO C++ FAQ). I suggest to add a new NK_free_config function that calls delete[] on a config array.
Alternatively, the NK_read_config function could be removed as the same data is returned by the NK_get_status function.
NK_read_config
returns a pointer to an array that is allocated usingnew[]
(induplicate_vector_and_clear
), so it should be deleted usingdelete[]
. But the user of the C API typically will only have access tofree
, which should not be used in this case (see e. g. the ISO C++ FAQ). I suggest to add a newNK_free_config
function that callsdelete[]
on a config array.Alternatively, the
NK_read_config
function could be removed as the same data is returned by theNK_get_status
function.