Fix memory leak.
authorTatsuo Ishii <ishii@postgresql.org>
Fri, 18 Jul 2025 05:40:14 +0000 (14:40 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Fri, 18 Jul 2025 05:45:09 +0000 (14:45 +0900)
Fix resource leak in pool_push_pending_data pointed out by Coverity.

Backpatch-through: v4.2

src/protocol/pool_process_query.c

index b69cb3d52e3af3d86155b9eaf6d5aef574ec99ef..467e50baa59a93cd54a433820ced93b041f4a231 100644 (file)
@@ -5304,6 +5304,8 @@ pool_push_pending_data(POOL_CONNECTION *backend)
                        ereport(DEBUG1,
                                        (errmsg("pool_push_pending_data: ERROR response found")));
                        pool_set_ignore_till_sync();
+                       if (buf)
+                               pfree(buf);
                        break;
                }
                num_pushed_messages++;