]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
malloc: remove redundant getenv call
authorGleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
Tue, 24 Nov 2015 16:19:32 +0000 (16:19 +0000)
committerGleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
Tue, 24 Nov 2015 17:07:12 +0000 (20:07 +0300)
* malloc/memusage.c (me): Remove redundant getenv call.

ChangeLog
malloc/memusage.c

index e16ad2cf0c69cec5e58268ea1d153bd5524da95c..0c8e4b2ad4690a8397b46ad47a7de3b83710c05b 100644 (file)
--- 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]
index a57ba8e25a89aec9c08d28f82384589b94432641..6de3344fc6213eccb1570cb67ec0269677a48878 100644 (file)
@@ -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;
                 }