note about putenv usage
This commit is contained in:
parent
e2bc612730
commit
839f308d60
1 changed files with 3 additions and 0 deletions
|
|
@ -1190,6 +1190,9 @@ static void do_locale_option(const char * const arg)
|
|||
char *str = malloc(len);
|
||||
snprintf(str, len, "LANG=%s", arg);
|
||||
putenv(str);
|
||||
// We leak "str" because it can not be freed. It is now part
|
||||
// of the environment. If it were local, the environment would
|
||||
// get corrupted.
|
||||
setlocale(LC_ALL, ""); /* use arg ? */
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue