>>>>> "André" == Andre Poenitz <[EMAIL PROTECTED]> writes:

André> I just had a look on what happened during the last two weeks.
André> One question: Why do we need a 'new' in
André> support/filetools.C:326? Couldn't this be replaced by a simple
André> putenv(envstr.c_str()) ? The man page mentions ENOMEM. I'd take
André> that as a hint that LyX does not need to alloc memory itself...

putenv() does not make a copy of the string which is passed to it (for
some unknown reason). What we do now leaks [*], but at least we will
not fall into the following trap (mentionned in tru64 unix man pages):

  A potential error is to call putenv() with an automatic variable as the
  argument and then exit the calling function while string is still part of
  the environment.

JMarc

[*] actually, we do not leak, since the function is not used (yet?)
  • putenv Andre Poenitz
    • Jean-Marc Lasgouttes

Reply via email to