Skip to content

Commit

Permalink
malloc: remove redundant getenv call
Browse files Browse the repository at this point in the history
* malloc/memusage.c (me): Remove redundant getenv call.
  • Loading branch information
Gleb Fotengauer-Malinovskiy committed Nov 24, 2015
1 parent 2359035 commit 87d0eec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
5 changes: 3 additions & 2 deletions malloc/memusage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 87d0eec

Please sign in to comment.