mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-10-21 23:52:28 +08:00
Merge branch 'bugfix/fix_newlib_environ_null' into 'master'
fix(newlib): fix environ is NULL See merge request sdk/ESP8266_RTOS_SDK!1571
This commit is contained in:
@@ -137,8 +137,15 @@ int esp_newlib_init(void)
|
|||||||
if (!_GLOBAL_REENT->_stdin)
|
if (!_GLOBAL_REENT->_stdin)
|
||||||
goto err_in;
|
goto err_in;
|
||||||
|
|
||||||
|
environ = malloc(sizeof(char*));
|
||||||
|
if (!environ)
|
||||||
|
goto err_env;
|
||||||
|
environ[0] = NULL;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
err_env:
|
||||||
|
fclose(_GLOBAL_REENT->_stdin);
|
||||||
err_in:
|
err_in:
|
||||||
fclose(_GLOBAL_REENT->_stderr);
|
fclose(_GLOBAL_REENT->_stderr);
|
||||||
err_fail:
|
err_fail:
|
||||||
|
Reference in New Issue
Block a user