From 9d1818902c053258956c3b8562d29afba4889e86 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Sun, 6 Jan 2013 13:43:45 +0100 Subject: [PATCH] re PR fortran/54678 (second call to get_environment_variable gives valgrind warning with 8-byte integers) 2013-01-06 Tobias Burnus PR fortran/54678 * intrinsics/env.c (get_environment_variable_i8): Don't use uninitialized variable. From-SVN: r194948 --- libgfortran/ChangeLog | 6 ++++++ libgfortran/intrinsics/env.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index e7142d8f354d..a5b4034dc381 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2013-01-06 Tobias Burnus + + PR fortran/54678 + * intrinsics/env.c (get_environment_variable_i8): Don't use + uninitialized variable. + 2013-01-02 Jerry DeLisle PR libfortran/55818 diff --git a/libgfortran/intrinsics/env.c b/libgfortran/intrinsics/env.c index 8836038488a9..252ee2f5c8a3 100644 --- a/libgfortran/intrinsics/env.c +++ b/libgfortran/intrinsics/env.c @@ -185,7 +185,8 @@ get_environment_variable_i8 (char *name, char *value, GFC_INTEGER_8 *length, trim_name4 = *trim_name; get_environment_variable_i4 (name, value, &length4, &status4, - &trim_name4, name_len, value_len); + trim_name ? &trim_name4 : NULL, + name_len, value_len); if (length) *length = length4;