mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[CMD] Clear global pointer to local variable after use
GCC 13 doesn't like if you keep a dangling pointer around.
C:/ReactOS/reactos/base/shell/cmd/for.c: In function 'ForF':
C:/ReactOS/reactos/base/shell/cmd/for.c:307:20: error: storing the address of local variable 'Variables' in '*fc.values' [-Werror=dangling-pointer=]
307 | fc->values = Variables;
| ~~~~~~~~~~~^~~~~~~~~~~
C:/ReactOS/reactos/base/shell/cmd/for.c:141:12: note: 'Variables' declared here
141 | LPTSTR Variables[32];
| ^~~~~~~~~
C:/ReactOS/reactos/base/shell/cmd/for.c:57:14: note: 'fc' declared here
57 | PFOR_CONTEXT fc = NULL;
| ^~
This commit is contained in:
@@ -474,6 +474,7 @@ Quit:
|
||||
if (fc->values && (fc->values != Variables))
|
||||
cmd_free(fc->values);
|
||||
#endif
|
||||
fc->values = NULL;
|
||||
|
||||
return Ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user