delete
incorrectly applied on some allocations from new[]
#4983
Labels
delete
incorrectly applied on some allocations from new[]
#4983
From #4982
The function
LGBM_BoosterFreePredictSparse
uses C++ operatordelete
to free outputs passed from the C side:LightGBM/src/c_api.cpp
Line 1969 in 0075814
These outputs are allocated with operator
new[]
:LightGBM/src/c_api.cpp
Line 599 in 0075814
Thus, it needs to use
delete[]
, notdelete
, otherwise it can lead to crashes and undefined behavior.The text was updated successfully, but these errors were encountered: