# HG changeset patch # User John W. Eaton # Date 1420655006 18000 # Node ID 146f1daa805be207b7db49001d447c26be4c00f6 # Parent 3b0a9a83236071066c7a39023230ccb92c1a0096 avoid valgrind warnings about using freed memory * sysdep.cc (Funsetenv): Explicitly create temporary std::string object. diff -r 3b0a9a832360 -r 146f1daa805b libinterp/corefcn/sysdep.cc --- a/libinterp/corefcn/sysdep.cc Mon Jan 05 17:44:00 2015 -0500 +++ b/libinterp/corefcn/sysdep.cc Wed Jan 07 13:23:26 2015 -0500 @@ -683,11 +683,11 @@ if (nargin == 1) { - const char *var = args(0).string_value ().c_str (); + std::string tmp = args(0).string_value (); if (! error_state) { - int status = gnulib::unsetenv (var); + int status = gnulib::unsetenv (tmp.c_str ()); retval = status; } }