From 08f49f01e3b3774e18eae397bb010b95ac96eeb2 Mon Sep 17 00:00:00 2001 From: Murai Takashi Date: Thu, 18 Feb 2021 06:12:05 +0900 Subject: [PATCH] mediaplayer: Fix new[] / delete mismatch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fItems are allocated by new[] at line 31, but deallocated by delete. Pointed out by Clang Static Analyzer. Change-Id: I1d8ae0b2214290155612d4b5c6d1ce56676cc892 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3746 Reviewed-by: Jérôme Duval --- src/apps/mediaplayer/playlist/MovePLItemsCommand.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/mediaplayer/playlist/MovePLItemsCommand.cpp b/src/apps/mediaplayer/playlist/MovePLItemsCommand.cpp index 6e28a106f8..989db8f6aa 100644 --- a/src/apps/mediaplayer/playlist/MovePLItemsCommand.cpp +++ b/src/apps/mediaplayer/playlist/MovePLItemsCommand.cpp @@ -34,7 +34,7 @@ MovePLItemsCommand::MovePLItemsCommand(Playlist* playlist, { if (indices.IsEmpty()) { // indicate a bad object state - delete fItems; + delete[] fItems; fItems = NULL; return; }