[PATCH 0/1] MR3085: vbscript: Use correct pointer type in add_match (scan-build).
From: Alex Henrie <alexhenrie24(a)gmail.com> --- dlls/vbscript/vbregexp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/vbscript/vbregexp.c b/dlls/vbscript/vbregexp.c index 641798f97dd..ec45c6d3db8 100644 --- a/dlls/vbscript/vbregexp.c +++ b/dlls/vbscript/vbregexp.c @@ -1024,12 +1024,12 @@ static HRESULT add_match(IMatchCollection2 *iface, IMatch2 *add) TRACE("(%p)->(%p)\n", This, add); if(!This->size) { - This->matches = malloc(8*sizeof(IMatch*)); + This->matches = malloc(8 * sizeof(IMatch2*)); if(!This->matches) return E_OUTOFMEMORY; This->size = 8; }else if(This->size == This->count) { - IMatch2 **new_matches = realloc(This->matches, 2*This->size*sizeof(IMatch*)); + IMatch2 **new_matches = realloc(This->matches, 2 * This->size * sizeof(IMatch2*)); if(!new_matches) return E_OUTOFMEMORY; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3085
Nikolay Sivov (@nsivov) commented about dlls/vbscript/vbregexp.c:
TRACE("(%p)->(%p)\n", This, add);
if(!This->size) { - This->matches = malloc(8*sizeof(IMatch*)); + This->matches = malloc(8 * sizeof(IMatch2*));
Or sizeof(*This->matches). -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3085#note_36020
On Sat Jun 17 17:43:54 2023 +0000, Nikolay Sivov wrote:
Or sizeof(*This->matches). @jacek As the maintainer of this module, what is your preference?
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/3085#note_37055
On Tue Jun 27 22:31:16 2023 +0000, Alex Henrie wrote:
@jacek As the maintainer of this module, what is your preference? Nikolay's proposal.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/3085#note_37616
participants (4)
-
Alex Henrie -
Alex Henrie (@alexhenrie) -
Jacek Caban (@jacek) -
Nikolay Sivov (@nsivov)