Re: [PATCH] Memory leak, at src/common/exec.c

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCH] Memory leak, at src/common/exec.c
Дата
Msg-id 29478.1576537771@sss.pgh.pa.us
обсуждение исходный текст
Ответ на RE: [PATCH] Memory leak, at src/common/exec.c  (Ranier Vilela <ranier_gyn@hotmail.com>)
Список pgsql-hackers
Ranier Vilela <ranier_gyn@hotmail.com> writes:
> According to the documentation at:
>
https://wiki.sei.cmu.edu/confluence/display/c/POS34-C.+Do+not+call+putenv%28%29+with+a+pointer+to+an+automatic+variable+as+the+argument
> "Using setenv() is easier and consequently less error prone than using putenv()."
> putenv is problematic and error prone, better replace by setenv.

setenv is also less portable: it does not appear in SUSv2, which is still
our baseline spec for Unix platforms.  We've avoided its use since 2001,
cf. ec7ddc158.

It's also fair to wonder how well this change would fly on Windows,
where we have to implement putenv for ourselves to get things to work
right (cf. src/port/win32env.c, which does not offer support for
setenv).

Please stop inventing reasons to change code that's worked fine for
decades.  We have better things to spend our time on.

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Ranier Vilela
Дата:
Сообщение: RE: [PATCH] Memory leak, at src/common/exec.c
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: ERROR: could not resize shared memory segment...No space left on device