Re: IF (NOT) EXISTS in psql-completion - Mailing list pgsql-hackers

From Kyotaro HORIGUCHI
Subject Re: IF (NOT) EXISTS in psql-completion
Date
Msg-id 20160330.144815.225518429.horiguchi.kyotaro@lab.ntt.co.jp
Whole thread Raw
In response to Re: IF (NOT) EXISTS in psql-completion  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
List pgsql-hackers
No one should care of this but to make shure..

At Tue, 29 Mar 2016 20:12:03 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> wrote in
<20160329.201203.78219296.horiguchi.kyotaro@lab.ntt.co.jp>
> By the way, memory blocks that readline sees are freed by it but
> blocks allocated by the additional pstrdup seems abandoned
> without being freed. Actually, the address of newly allocated
> blocks seems increasing time by time slowly *even without this
> patch*..

psql doesn't leak memory. The increment was the result of new
history entry. src/common/exec.c does the following thing,

./common/exec.c:586:        putenv(strdup(env_path));
./common/exec.c:597:        putenv(strdup(env_path));

valgrind complains that the memory block allocated there is
definitely lost but it seems to be called once in lifetime of a
process.

regards,

-- 
Kyotaro Horiguchi
NTT Open Source Software Center





pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: multivariate statistics v14
Next
From: Harshal Dhumal
Date:
Subject: [postgresSQL] [bug] Two or more different types of constraints with same name creates ambiguity while drooping.