[haiku-commits] Change in haiku[master]: haikudepot: Fix 'new[]' array freed with 'delete'

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: waddlesplash <waddlesplash@xxxxxxxxx>, haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 8 Feb 2020 02:18:33 +0000

From Murai Takashi <tmurai01@xxxxxxxxx>:

Murai Takashi has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/2226 ;)


Change subject: haikudepot: Fix 'new[]' array freed with 'delete'
......................................................................

haikudepot: Fix 'new[]' array freed with 'delete'

buffer is allocated by new[] in _UnpackCaptcha(), but freed by delete.
Pointed out by LGTM.

Change-Id: I6feee3f9791950c33bbc2037c7809e21f250fa47
---
M src/apps/haikudepot/ui/UserLoginWindow.cpp
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/26/2226/1

diff --git a/src/apps/haikudepot/ui/UserLoginWindow.cpp 
b/src/apps/haikudepot/ui/UserLoginWindow.cpp
index 643d40f..f879c4f 100644
--- a/src/apps/haikudepot/ui/UserLoginWindow.cpp
+++ b/src/apps/haikudepot/ui/UserLoginWindow.cpp
@@ -875,7 +875,7 @@
                        captcha.SetToken(token);
                        captcha.SetPngImageData(buffer, decodedSize);
                }
-               delete buffer;
+               delete[] buffer;
        }

        return result;

--
To view, visit https://review.haiku-os.org/c/haiku/+/2226
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: I6feee3f9791950c33bbc2037c7809e21f250fa47
Gerrit-Change-Number: 2226
Gerrit-PatchSet: 1
Gerrit-Owner: Murai Takashi <tmurai01@xxxxxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in haiku[master]: haikudepot: Fix 'new[]' array freed with 'delete' - Gerrit