diff options
author | Omair Majid <omajid@redhat.com> | 2019-04-16 01:12:39 -0400 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2019-04-15 22:12:39 -0700 |
commit | 0f838a7c22c6e19748582ced5e03a8e273f63062 (patch) | |
tree | ae2096443906a638c83c9753cf2577383f52fc8b /src/md | |
parent | f6938e2b5497cce88ab7b3643ab5f3174d8bb3e7 (diff) | |
download | coreclr-0f838a7c22c6e19748582ced5e03a8e273f63062.tar.gz coreclr-0f838a7c22c6e19748582ced5e03a8e273f63062.tar.bz2 coreclr-0f838a7c22c6e19748582ced5e03a8e273f63062.zip |
Use NewArrayHolder for array types (#24017)
This touches all the code outside of src/debug/.
Using a NewHolder with array types means that when the holder is ready
to release the memory, it ends up invoking `delete` (instead of
`delete[]`) on that array. This is an undefined behaviour.
Use NewArrayHolder instead to fix this.
Diffstat (limited to 'src/md')
-rw-r--r-- | src/md/runtime/mdinternalro.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/md/runtime/mdinternalro.cpp b/src/md/runtime/mdinternalro.cpp index d16d2b02eb..a4f59a37b2 100644 --- a/src/md/runtime/mdinternalro.cpp +++ b/src/md/runtime/mdinternalro.cpp @@ -2172,7 +2172,7 @@ HRESULT MDInternalRO::GetPropertyInfoForMethodDef( // Result. // Lazy initialization of m_pMethodSemanticsMap if ((ridMax > 10) && (m_pMethodSemanticsMap == NULL)) { - NewHolder<CMethodSemanticsMap> pMethodSemanticsMap = new (nothrow) CMethodSemanticsMap[ridMax]; + NewArrayHolder<CMethodSemanticsMap> pMethodSemanticsMap = new (nothrow) CMethodSemanticsMap[ridMax]; if (pMethodSemanticsMap != NULL) { // Fill the table in MethodSemantics order. |