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

From: Ranier Vilela <ranier_gyn(at)hotmail(dot)com>
To: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: RE: [PATCH] Memory leak, at src/common/exec.c
Date: 2019-12-16 22:44:21
Message-ID: SN2PR05MB264066382E2CC75E734492C8E3510@SN2PR05MB2640.namprd05.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

As a result, set_pglocale_pgservice, is much simpler and more readable.

regards,
Ranier Vilela

Attachment Content-Type Size
exec_v2.patch text/x-patch 2.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-12-16 23:09:31 Re: [PATCH] Memory leak, at src/common/exec.c
Previous Message Tom Lane 2019-12-16 22:33:16 Re: [PATCH] Memory leak, at src/common/exec.c