Re: ALTER SYSTEM SET command to change postgresql.conf parameters
От | Tatsuo Ishii |
---|---|
Тема | Re: ALTER SYSTEM SET command to change postgresql.conf parameters |
Дата | |
Msg-id | 20131218.235541.235834015040324654.t-ishii@sraoss.co.jp обсуждение исходный текст |
Ответ на | Re: ALTER SYSTEM SET command to change postgresql.conf parameters (Amit Kapila <amit.kapila16@gmail.com>) |
Ответы |
Re: ALTER SYSTEM SET command to change postgresql.conf parameters
|
Список | pgsql-hackers |
>> Is there any reason for the function returns int as it always returns >> 0 or 1. Maybe returns bool is better? > > No, return type should be bool, I have changed the same in attached patch. Confirmed. >> 2) initdb.c >> >> + strcpy(tempautobuf, "# Do not edit this file manually! \n"); >> + autoconflines[0] = pg_strdup(tempautobuf); >> + strcpy(tempautobuf, "# It will be overwritten by the ALTER SYSTEM command. \n"); >> + autoconflines[1] = pg_strdup(tempautobuf); >> >> Is there any reason to use "tempautobuf" here? I think we can simply change to this: >> >> + autoconflines[0] = pg_strdup("# Do not edit this file manually! \n"); >> + autoconflines[1] = pg_strdup("# It will be overwritten by the ALTER SYSTEM command. \n"); > > You are right, I have changed code as per your suggestion. Confirmed. >> 3) initdb.c >> >> It seems the memory allocated for autoconflines[0] and >> autoconflines[1] by pg_strdup is never freed. > > I think, it gets freed in writefile() in below code. Oh, I see. Sorry for noise. I have committed your patches. Thanks. -- Tatsuo Ishii SRA OSS, Inc. Japan English: http://www.sraoss.co.jp/index_en.php Japanese: http://www.sraoss.co.jp
В списке pgsql-hackers по дате отправления: