list_free in addRangeTableEntryForJoin

Поиск
Список
Период
Сортировка
От Ilia Evdokimov
Тема list_free in addRangeTableEntryForJoin
Дата
Msg-id ff7f8032-4f39-4df0-9941-b4b7e03f67c3@tantorlabs.com
обсуждение исходный текст
Ответы Re: list_free in addRangeTableEntryForJoin
Re: list_free in addRangeTableEntryForJoin
Re: list_free in addRangeTableEntryForJoin
Список pgsql-hackers
Hi Hackers

I have identified a potential memory leak in the 
`addRangeTableEntryForJoin()` function. The second parameter of 
`addRangeTableEntryForJoin()`, `colnames`, is a `List*` that is 
concatenated with another `List*`, `eref->colnames`, using 
`list_concat()`. We need to pass only the last `numaliases` elements of 
the list, for which we use `list_copy_tail`. This function creates a 
copy of the `colnames` list, resulting in `colnames` pointing to the 
current list that will not be freed. Consequently, a new list is already 
concatenated.

To address this issue, I have invoked `list_free(colnames)` afterwards. 
If anyone is aware of where the list is being freed or has any 
suggestions for improvement, I would greatly appreciate your input.

Best Regards,

Ilia Evdokimov,

TantorLabs LCC

Вложения

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

Предыдущее
От: Daniel Gustafsson
Дата:
Сообщение: Re: Add support to TLS 1.3 cipher suites and curves lists
Следующее
От: shveta malik
Дата:
Сообщение: Re: Conflict Detection and Resolution