From 3b3a91a0aa957cb2d9ee1ca9791634dcc41f68cc Mon Sep 17 00:00:00 2001 From: serb Date: Fri, 3 Apr 2015 12:41:13 +0100 Subject: [PATCH] 8073559: Memory leak in jdk/src/windows/native/sun/windows/awt_InputTextInfor.cpp Reviewed-by: prr, azvegint --- src/windows/native/sun/windows/awt_InputTextInfor.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/windows/native/sun/windows/awt_InputTextInfor.cpp b/src/windows/native/sun/windows/awt_InputTextInfor.cpp index 4ccf0d55e..de9248f13 100644 --- a/src/windows/native/sun/windows/awt_InputTextInfor.cpp +++ b/src/windows/native/sun/windows/awt_InputTextInfor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -310,6 +310,8 @@ int AwtInputTextInfor::GetClauseInfor(int*& lpBndClauseW, jstring*& lpReadingCla readingMergedClauseW = new jstring[cMergedClauseW]; } catch (std::bad_alloc&) { delete [] bndMergedClauseW; + delete [] bndClauseW; + delete [] readingClauseW; throw; } @@ -394,6 +396,8 @@ int AwtInputTextInfor::GetAttributeInfor(int*& lpBndAttrW, BYTE*& lpValAttrW) { valMergedAttrW = new BYTE[cMergedAttrW]; } catch (std::bad_alloc&) { delete [] bndMergedAttrW; + delete [] bndAttrW; + delete [] valAttrW; throw; } bndMergedAttrW[0] = 0; -- GitLab