From: | Saladin <312199339(at)qq(dot)com> |
---|---|
To: | pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | [PATCH] Fix Potential Memory Leak in pg_amcheck Code |
Date: | 2025-02-07 07:04:45 |
Message-ID: | tencent_F34922C91C41E76C734773E767C9FBDB9906@qq.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
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 | Content-Type | Size |
---|---|---|
0001-pg_amcheck-prevent-potential-memory-leak.patch | application/octet-stream | 821 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Smith | 2025-02-07 07:16:54 | Re: Avoid updating inactive_since for invalid replication slots |
Previous Message | Michael Paquier | 2025-02-07 06:47:02 | Re: Fix for a crash caused by triggers in cross-partition updates |