mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-19 07:00:08 +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;
|
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;
|
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] == '=')
|
if (!strncmp (*ep, name, namelen) && (*ep)[namelen] == '=')
|
||||||
break;
|
break;
|
||||||
else
|
else
|
||||||
++size;
|
++size;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (__environ == NULL || *ep == NULL)
|
if (ep == NULL || *ep == NULL)
|
||||||
{
|
{
|
||||||
char **new_environ;
|
char **new_environ;
|
||||||
#ifdef USE_TSEARCH
|
#ifdef USE_TSEARCH
|
||||||
|
Loading…
Reference in New Issue
Block a user