diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 7685a7cd9..4f4879b71 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,7 @@ +2002-04-01 Till Straumann + + * libc/stdlib/getenv_r.c (_findenv_r): Add missing ENV_UNLOCK. + Wed Mar 27 07:34:44 2002 Jason Tishler * libc/include/sys/features.h (_POSIX_SEMAPHORES): New Cygwin define. diff --git a/newlib/libc/stdlib/getenv_r.c b/newlib/libc/stdlib/getenv_r.c index 4d567c718..2cc48cfd7 100644 --- a/newlib/libc/stdlib/getenv_r.c +++ b/newlib/libc/stdlib/getenv_r.c @@ -94,7 +94,10 @@ _DEFUN (_findenv_r, (reent_ptr, name, offset), /* In some embedded systems, this does not get set. This protects newlib from dereferencing a bad pointer. */ if (!*p_environ) - return NULL; + { + ENV_UNLOCK; + return NULL; + } c = name; len = 0;