pgbackrest.git / summary / log / commit / refs
commit 0b349c0f2f54d1e45beaa604dba40c2cf9efc15e
Author: David Steele <david@pgmasters.net>
Date: Fri Aug 07 17:44:01 2020 +0000
Clear the callback before calling storageReadPosixFreeResource().
If storageReadPosixFreeResource() errors then it will be called again when the object is freed, which is not ideal since it might error in a different way and lose the original error.
src/storage/posix/read.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/storage/posix/read.c b/src/storage/posix/read.c
index 6083504dd..1f872a57a 100644
--- a/src/storage/posix/read.c
+++ b/src/storage/posix/read.c
@@ -154,8 +154,8 @@ storageReadPosixClose(THIS_VOID)
ASSERT(this != NULL);
- storageReadPosixFreeResource(this);
memContextCallbackClear(this->memContext);
+ storageReadPosixFreeResource(this);
this->fd = -1;
FUNCTION_LOG_RETURN_VOID();
[parent: cde2c756ea8a]