fix realloc-of-non-malloced pointer, and reduce size while at it
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user