Changeset 197


Ignore:
Timestamp:
Sep 8, 2006, 4:05:34 PM (13 years ago)
Author:
Peter Johansson
Message:

removed question/comment as I found the answer

"getenv returns a ptr to where the environment variable PATH is defined. You
don't allocate for it, it is automatically allocated when the code is executed.
It is not stack memory, because it is static.

getenv doesn't allocate memory, it simply returns a pointer to where the string
represented by PATH exists."

from http://www.thescripts.com/forum/thread213200.html

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Gnuplot.cc

    r149 r197  
    5757  void Gnuplot::acquire_program_path(const std::string& progname)
    5858  {
    59     char* env_path=getenv("PATH");  // is there a need to free this memory?
     59    char* env_path=getenv("PATH");
    6060    if (!env_path)
    6161      throw GnuplotException("Environment variable PATH is not set");
Note: See TracChangeset for help on using the changeset viewer.