# HG changeset patch
# User Olaf Wintermann <olaf.wintermann@gmail.com>
# Date 1643661226 -3600
# Node ID d0d5a970292fcba992506b2ebbc576c8187ce10d
# Parent  79029fe26aae791511091567bb4f578bfb051e26
implement pg_vfs_dirio_close

diff -r 79029fe26aae -r d0d5a970292f src/server/plugins/postgresql/vfs.c
--- a/src/server/plugins/postgresql/vfs.c	Mon Jan 31 17:18:12 2022 +0100
+++ b/src/server/plugins/postgresql/vfs.c	Mon Jan 31 21:33:46 2022 +0100
@@ -366,5 +366,15 @@
 }
 
 void pg_vfs_dirio_close(VFS_DIR dir) {
+    pool_handle_t *pool = dir->ctx->pool;
+    PgDir *pg = dir->data;
+    if(pg->result) {
+        PQclear(pg->result);
+    }
+    PgFile *pgfile = pg->file->data;
     
+    pool_free(pool, pgfile);
+    pool_free(pool, pg->file);
+    pool_free(pool, pg);
+    pool_free(pool, dir);
 }