Re: Assitance needed for the resolution of memory leak

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Assitance needed for the resolution of memory leak
Дата
Msg-id 881280.1697056635@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Assitance needed for the resolution of memory leak  (Sasmit Utkarsh <utkarshsasmit@gmail.com>)
Ответы Re: Assitance needed for the resolution of memory leak
Список pgsql-general
Sasmit Utkarsh <utkarshsasmit@gmail.com> writes:
> Like for an ex: I have provided the test run for a file which has 4
> duplicate entries in the input file and below is the leak reported. I have
> followed
> consistently using PQclear to free all PGresult objects.

No you haven't: you've got two PQexec-something calls and
only one PQclear.  If control reaches here:

> res = PQexec(conn, Command);

that will overwrite your only pointer to the PQexecParams
result, and you won't clear it.

BTW, if this is what your code actually looks like in your editor,
it's no wonder you can't follow its basic control flow.  Indent
according to the brace structure, and your life will get easier.

            regards, tom lane



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

Предыдущее
От: Sasmit Utkarsh
Дата:
Сообщение: Re: Assitance needed for the resolution of memory leak
Следующее
От: Sasmit Utkarsh
Дата:
Сообщение: Re: Assitance needed for the resolution of memory leak