Commit df9c3c2
committed
Use 'environ' C extern for environment variables (except Mac OS)
The function __fort_getenv uses the C extern
variable environ to get the values of the environment
variables. What's happening is 'environ' is getting
reallocated, but this code caches a value of 'environ'
in a local static pointer 'env' and dereferences
that. The old values in the old copy of 'environ'
that 'env' points to are no longer valid. The code
has been fixed using 'environ' directly rather than
using the local static pointer.1 parent 965f574 commit df9c3c2
1 file changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
| 407 | + | |
407 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
408 | 412 | | |
409 | 413 | | |
410 | 414 | | |
| |||
0 commit comments