mirror of
https://github.com/reactos/reactos.git
synced 2026-05-22 23:30:07 +08:00
Make the code simpler, so GCC doesn't get confused.
C:/ReactOS/reactos/base/shell/cmd/misc.c: In function 'add_entry':
C:/ReactOS/reactos/base/shell/cmd/misc.c:216:14: error: pointer 'oldarg' may be used after 'realloc' [-Werror=use-after-free]
216 | *arg = oldarg;
| ~~~~~^~~~~~~~
In file included from C:/ReactOS/reactos/base/shell/cmd/cmd.h:29,
from C:/ReactOS/reactos/base/shell/cmd/precomp.h:34,
from C:/ReactOS/reactos/base/shell/cmd/misc.c:35:
C:/ReactOS/reactos/base/shell/cmd/cmddbg.h:30:31: note: call to 'realloc' here
30 | #define cmd_realloc(ptr,size) realloc(ptr, size)
| ^~~~~~~~~~~~~~~~~~
C:/ReactOS/reactos/base/shell/cmd/misc.c:212:12: note: in expansion of macro 'cmd_realloc'
212 | *arg = cmd_realloc (oldarg, (*ac + 2) * sizeof (LPTSTR));
| ^~~~~~~~~~~