From 944eccea68bfe53a2018efdfb1233155653366af Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Thu, 2 Mar 2017 22:38:52 +0100 Subject: [PATCH] Use new[] instead of malloc() --- src/msw/dc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index b7c8e9dd49..551377e88f 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -1103,7 +1103,7 @@ void wxMSWDCImpl::DoDrawSpline(const wxPointList *points) wxASSERT_MSG( n_points > 2 , wxT("incomplete list of spline points?") ); const size_t n_bezier_points = n_points * 3 + 1; - POINT *lppt = (POINT *)malloc(n_bezier_points*sizeof(POINT)); + POINT *lppt = new POINT[n_bezier_points]; size_t bezier_pos = 0; wxCoord x1, y1, x2, y2, cx1, cy1, cx4, cy4; @@ -1172,7 +1172,7 @@ void wxMSWDCImpl::DoDrawSpline(const wxPointList *points) ::PolyBezier( GetHdc(), lppt, bezier_pos ); - free(lppt); + delete []lppt; } #endif // wxUSE_SPLINES