mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-18 22:50:07 +00:00
(__add_to_environ): Initialize ep after we have the lock.
Avoid warning about uninitialized variable.
This commit is contained in:
parent
336c2454d6
commit
9c4140bada
@ -120,17 +120,21 @@ __add_to_environ (name, value, combined, replace)
|
||||
|
||||
LOCK;
|
||||
|
||||
/* We have to get the pointer now that we have the lock and not earlier
|
||||
since another thread might have created a new environment. */
|
||||
ep = __environ;
|
||||
|
||||
size = 0;
|
||||
if (__environ != NULL)
|
||||
if (ep != NULL)
|
||||
{
|
||||
for (ep = __environ; *ep != NULL; ++ep)
|
||||
for (; *ep != NULL; ++ep)
|
||||
if (!strncmp (*ep, name, namelen) && (*ep)[namelen] == '=')
|
||||
break;
|
||||
else
|
||||
++size;
|
||||
}
|
||||
|
||||
if (__environ == NULL || *ep == NULL)
|
||||
if (ep == NULL || *ep == NULL)
|
||||
{
|
||||
char **new_environ;
|
||||
#ifdef USE_TSEARCH
|
||||
|
Loading…
Reference in New Issue
Block a user