Re: [PATCHES] Re: [HACKERS] Everything leaks; How it mm suppose to work?

Поиск
Список
Период
Сортировка
От Vadim B. Mikheev
Тема Re: [PATCHES] Re: [HACKERS] Everything leaks; How it mm suppose to work?
Дата
Msg-id 35278D31.5115AC54@sable.krasnoyarsk.su
обсуждение исходный текст
Ответы Re: [PATCHES] Re: [HACKERS] Everything leaks; How it mm suppose to work?
Список pgsql-hackers
Bruce Momjian wrote:
>
> > I seem to recall a discussion a long time ago about using strdup and how
> > it would leak when using the postgres memory contexts, and that the pstrdup
> > code was created to be used instead of strdup to "fix" this.
> >
>
> OK, here is a patch to fix the memory leak problem.  Not sure when this
> was introduced, but who cares.  Probably not Vadim, as I first thought.

(Sure - not me :). Congratulations with finding this!
storage/buffer/bufmgr.c:BufferAlloc():

    strcpy(buf->sb_dbname, GetDatabaseName());

and so we had leak for _every_ new buffer allocation!

But why strdup() was added there? (Hope that nothing is broken now).

Vadim

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

Предыдущее
От: "Thomas G. Lockhart"
Дата:
Сообщение: Re: [HACKERS] Open 6.3.1 issues
Следующее
От: "Thomas G. Lockhart"
Дата:
Сообщение: Automatic type conversion