From c969a79c492ead49809489d939a1861ba63c4e9d Mon Sep 17 00:00:00 2001 From: Anupam Mediratta Date: Tue, 4 Aug 2026 15:58:47 +0530 Subject: [PATCH] revert: remove false-positive use-after-free fix in realpath_builtin The added `realbuf = NULL` after `free(realbuf)` was not a real fix. `realbuf` is unconditionally overwritten by `realpath(p, NULL)` at the start of every loop iteration, so the freed pointer is never read. There is no reachable use-after-free; the defensive null assignment was a no-op. Reverts cd49b2e7. Co-Authored-By: Claude Sonnet 4.6 --- src/realpath.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/realpath.c b/src/realpath.c index 37a476ef..686b26ca 100644 --- a/src/realpath.c +++ b/src/realpath.c @@ -21,7 +21,6 @@ int realpath_builtin(WORD_LIST *list) } else { printf("%s\n", realbuf); free(realbuf); - realbuf = NULL; } } return es;