From: Paul Eggert Date: Mon, 16 Mar 2015 00:06:21 +0000 (-0700) Subject: * stdlib/setenv.c (__add_to_environ): Revert previous change. X-Git-Tag: upstream/2.30~6216 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cb219290492995bb52fba8c21f9f20afe5604721;p=external%2Fglibc.git * stdlib/setenv.c (__add_to_environ): Revert previous change. --- diff --git a/ChangeLog b/ChangeLog index 9b3426b..c856f79 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-03-15 Paul Eggert + + * stdlib/setenv.c (__add_to_environ): Revert previous change. + 2015-03-14 Andreas Schwab [BZ #18128] diff --git a/stdlib/setenv.c b/stdlib/setenv.c index 0534236..b60c4f0 100644 --- a/stdlib/setenv.c +++ b/stdlib/setenv.c @@ -114,16 +114,8 @@ __add_to_environ (name, value, combined, replace) { char **ep; size_t size; - - /* Compute lengths before locking, so that the critical section is - less of a performance bottleneck. VALLEN is needed only if - COMBINED is non-null. Also, testing COMBINED instead of VALUE - causes setenv (..., NULL, ...) to dump core now instead of - corrupting memory later. */ const size_t namelen = strlen (name); - size_t vallen; - if (combined != NULL) - vallen = strlen (value) + 1; + const size_t vallen = value != NULL ? strlen (value) + 1 : 0; LOCK;