fix realloc-of-non-malloced pointer, and reduce size while at it

This commit is contained in:
Denis Vlasenko
2007-04-12 17:08:53 +00:00
parent 0de3c55b42
commit 7cced6e574
2 changed files with 15 additions and 15 deletions

View File

@ -423,7 +423,7 @@ static const struct built_in_command bltins[] = {
static const char *set_cwd(void)
{
if (cwd == bb_msg_unknown)
cwd = NULL; /* xrealloc_getcwd_or_warn(arg) called free(arg) */
cwd = NULL; /* xrealloc_getcwd_or_warn(arg) calls free(arg)! */
cwd = xrealloc_getcwd_or_warn((char *)cwd);
if (!cwd)
cwd = bb_msg_unknown;