aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Fotengauer-Malinovskiy <glebfm@altlinux.org>2015-11-24 16:19:32 +0000
committerGleb Fotengauer-Malinovskiy <glebfm@altlinux.org>2015-11-24 20:07:12 +0300
commit87d0eecece0ecefaca6a7eedb715cb823b3ef780 (patch)
treee412e8b46683bcdb74eb8a8c36f01f41eb4dc1f5
parent2359035ac52db69eb427c3b4b9d9297c98d2b225 (diff)
downloadglibc-87d0eecece0ecefaca6a7eedb715cb823b3ef780.tar
glibc-87d0eecece0ecefaca6a7eedb715cb823b3ef780.tar.gz
glibc-87d0eecece0ecefaca6a7eedb715cb823b3ef780.tar.bz2
glibc-87d0eecece0ecefaca6a7eedb715cb823b3ef780.zip
malloc: remove redundant getenv call
* malloc/memusage.c (me): Remove redundant getenv call.
-rw-r--r--ChangeLog4
-rw-r--r--malloc/memusage.c5
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e16ad2cf0c..0c8e4b2ad4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2015-11-24 Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
+
+ * malloc/memusage.c (me): Remove redundant getenv call.
+
2015-10-24 Florian Weimer <fweimer@redhat.com>
[BZ #19143]
diff --git a/malloc/memusage.c b/malloc/memusage.c
index a57ba8e25a..6de3344fc6 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;
}