Dear pgsql-hackers,



While reviewing the code of pg_amcheck, I discovered a potential issue 
that could lead to a memory leak. Specifically, there is a 
missing PQclear(result) call before the database connection is 
disconnected, which could leave the query result unfreed.




To resolve this, I have created a patch that 
ensures PQclear(result) is called prior to 
the disconnectDatabase(conn) function. This small change ensures 
proper memory management by cleaning up the query result before closing the 
connection.




Please find the patch attached for your review.




I would appreciate any feedback or suggestions on this fix. If it looks good, I 
would be happy to proceed with any necessary steps to contribute it to the 
project.

Thank you for your time and consideration.




--

Best regards,
JiaoShuntian,
Highgo Software.

Attachment: 0001-pg_amcheck-prevent-potential-memory-leak.patch
Description: Binary data

Reply via email to