Partially allocating a structure generates -Warray-bounds warnings with GCC11 In this specific case, given the rounding in memory allocators, would even not increase the effective allocated size
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/shell32/pidl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/shell32/pidl.c b/dlls/shell32/pidl.c index 4c66a14c700..f9c91a79132 100644 --- a/dlls/shell32/pidl.c +++ b/dlls/shell32/pidl.c @@ -1574,7 +1574,7 @@ LPITEMIDLIST _ILCreateDesktop(void) LPITEMIDLIST ret;
TRACE("()\n"); - ret = SHAlloc(2); + ret = SHAlloc(sizeof(*ret)); if (ret) ret->mkid.cb = 0; return ret;