Hi,
I have found a memory leak in PostgreSQL 7.3.4,
src/interfaces/libpq/fe-exec.c line 279:
buffer = realloc(buffer, buflen);
if (buffer == NULL)
return NULL;
The realloc manpage says:
"If realloc() fails the original block is left untouched - it is
not freed or moved."
i.e. "buffer" is not freed if there is not enough memory for
realloc. The code should be like this:
temp_buffer = realloc(buffer, buflen);
if (temp_buffer == NULL) {
free(buffer);
return NULL;
}
buffer = temp_buffer;
Regards,
Max Kellermann
Max Kellermann <max@linuxtag.org> writes:
> I have found a memory leak in PostgreSQL 7.3.4,
> src/interfaces/libpq/fe-exec.c line 279:
This appears to have been dealt with already (although realistically,
it would be an extremely brain-dead realloc that could ever fail here,
since the block is being shrunk not grown).
regards, tom lane
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера