From 2e37c88d2bb25ef8cd614ef7a5489152227dc9f5 Mon Sep 17 00:00:00 2001 From: Murai Takashi Date: Sat, 8 Feb 2020 06:19:13 +0900 Subject: [PATCH] haikudepot: Fix 'new[]' array freed with 'delete' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit buffer is allocated by new[] in _UnpackCaptcha(), but freed by delete. Pointed out by LGTM. Change-Id: I6feee3f9791950c33bbc2037c7809e21f250fa47 Reviewed-on: https://review.haiku-os.org/c/haiku/+/2226 Reviewed-by: Jérôme Duval --- src/apps/haikudepot/ui/UserLoginWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/haikudepot/ui/UserLoginWindow.cpp b/src/apps/haikudepot/ui/UserLoginWindow.cpp index 643d40fcf4..f879c4f8cb 100644 --- a/src/apps/haikudepot/ui/UserLoginWindow.cpp +++ b/src/apps/haikudepot/ui/UserLoginWindow.cpp @@ -875,7 +875,7 @@ UserLoginWindow::_UnpackCaptcha(BMessage& responsePayload, Captcha& captcha) captcha.SetToken(token); captcha.SetPngImageData(buffer, decodedSize); } - delete buffer; + delete[] buffer; } return result;