Re: pgsql: Fix inconsequential FILE pointer leakage

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pgsql: Fix inconsequential FILE pointer leakage
Дата
Msg-id 11112.1292529643@sss.pgh.pa.us
обсуждение исходный текст
Ответ на pgsql: Fix inconsequential FILE pointer leakage  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Ответы Re: pgsql: Fix inconsequential FILE pointer leakage
Список pgsql-committers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:

--- a/src/port/exec.c
+++ b/src/port/exec.c
@@ -357,6 +357,7 @@ pipe_read_line(char *cmd, char *line, int maxsize)

    if (fgets(line, maxsize, pgver) == NULL)
    {
+       pclose(pgver);      /* no error checking */
        perror("fgets failure");
        return NULL;
    }

Doesn't this risk having pclose trash the errno setting that perror is
going to print?  If you must do this, please do it in the other order.

            regards, tom lane

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