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 <noreply@anthropic.com>
This commit is contained in:
Anupam Mediratta 2026-08-04 15:58:47 +05:30
parent cd49b2e7c1
commit c969a79c49

View file

@ -21,7 +21,6 @@ int realpath_builtin(WORD_LIST *list)
} else {
printf("%s\n", realbuf);
free(realbuf);
realbuf = NULL;
}
}
return es;