You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @description An object that was allocated with 'new' is being freed using 'delete[]'. Behavior in such cases is undefined and should be avoided. Use 'delete' instead.
* @kind problem
* @problem.severity warning
* @precision high
* @id cpp/new-delete-array-mismatch
* @tags reliability
*/
import NewDelete
fromExpralloc,Exprfree,Exprfreed
where
allocReaches(freed,alloc,"new")and
freeExprOrIndirect(free,freed,"delete[]")
selectfree,"This memory may have been allocated with $@, not 'new[]'.",alloc,"new"