From: Alex Henrie alexhenrie24@gmail.com
GCC 13 thinks that there is a use-after-free here and warns about it. We actually don't need to check the return value of realloc here at all because shrinking an allocation is guaranteed to succeed. --- dlls/d3drm/texture.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/dlls/d3drm/texture.c b/dlls/d3drm/texture.c index f0983d53e24..b06d68cc881 100644 --- a/dlls/d3drm/texture.c +++ b/dlls/d3drm/texture.c @@ -153,8 +153,7 @@ static BOOL d3drm_image_palettise(D3DRMIMAGE *image, unsigned char *src_data, image->green_mask = 0xff; image->blue_mask = 0xff; image->palette_size = colour_count; - if (!(image->palette = realloc(palette, colour_count * sizeof(*palette)))) - image->palette = palette; + image->palette = realloc(palette, colour_count * sizeof(*palette));
return TRUE; }