Leaking memory in text_overlay function

Поиск
Список
Период
Сортировка
От Dirk Rudolph
Тема Leaking memory in text_overlay function
Дата
Msg-id 729758F1-1F95-4484-846B-994314498902@netcentric.biz
обсуждение исходный текст
Ответы Re: Leaking memory in text_overlay function  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

while implementing my own C function, I mentioned that some memory is not freed by the text_overlay function in varlena.c

Particularly I mean the both substrings allocated by text_substring (according to the documentation of text_substring "The result is always a freshly palloc'd datum.") and one of the concatenation results. I’m aware of the MemoryContext being deleted in my case but IMHO builtin functions should be memory safe. (or at least the others I used are).

See attached a patch that fixes that against HEAD.

Cheers, 

Dirk Rudolph | Senior Software Engineer

Netcentric AG

M: +41 79 642 37 11
D: +49 174 966 84 34

dirk.rudolph@netcentric.biz www.netcentric.biz

Вложения

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

Предыдущее
От: Christoph Berg
Дата:
Сообщение: Re: OpenSSL 1.1 breaks configure and more
Следующее
От: Craig Ringer
Дата:
Сообщение: Docs, backups, and MS VSS