From: Gleb Fotengauer-Malinovskiy Date: Tue, 24 Nov 2015 16:19:32 +0000 (+0000) Subject: malloc: remove redundant getenv call X-Git-Tag: glibc-2.23~176 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87d0eecece0ecefaca6a7eedb715cb823b3ef780;p=thirdparty%2Fglibc.git malloc: remove redundant getenv call * malloc/memusage.c (me): Remove redundant getenv call. --- diff --git a/ChangeLog b/ChangeLog index e16ad2cf0c6..0c8e4b2ad46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-11-24 Gleb Fotengauer-Malinovskiy + + * malloc/memusage.c (me): Remove redundant getenv call. + 2015-10-24 Florian Weimer [BZ #19143] diff --git a/malloc/memusage.c b/malloc/memusage.c index a57ba8e25a8..6de3344fc62 100644 --- a/malloc/memusage.c +++ b/malloc/memusage.c @@ -276,9 +276,10 @@ me (void) /* Determine the buffer size. We use the default if the environment variable is not present. */ buffer_size = DEFAULT_BUFFER_SIZE; - if (getenv ("MEMUSAGE_BUFFER_SIZE") != NULL) + const char *str_buffer_size = getenv ("MEMUSAGE_BUFFER_SIZE"); + if (str_buffer_size != NULL) { - buffer_size = atoi (getenv ("MEMUSAGE_BUFFER_SIZE")); + buffer_size = atoi (str_buffer_size); if (buffer_size == 0 || buffer_size > DEFAULT_BUFFER_SIZE) buffer_size = DEFAULT_BUFFER_SIZE; }