From 3413675193b96a08885242399f2ce80966898fa4 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 19 Jan 2026 18:03:39 +0200 Subject: [PATCH] [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; | ^~ --- base/shell/cmd/for.c | 1 + 1 file changed, 1 insertion(+) diff --git a/base/shell/cmd/for.c b/base/shell/cmd/for.c index 151be0ca2c8..adb0c5be89f 100644 --- a/base/shell/cmd/for.c +++ b/base/shell/cmd/for.c @@ -474,6 +474,7 @@ Quit: if (fc->values && (fc->values != Variables)) cmd_free(fc->values); #endif + fc->values = NULL; return Ret; }