summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim B. Mikheev1998-07-22 05:48:59 +0000
committerVadim B. Mikheev1998-07-22 05:48:59 +0000
commit2a677424122012d2eaa4c6d1113fc6b9b121720b (patch)
tree1ed9e28e2edbe72387bc952185c7768d325572df
parent5afe171443d1082f4998ca320db5cff892504ff4 (diff)
Fix _lo_commit: core if LO memmory context was not created (LO were not used?)
-rw-r--r--src/backend/libpq/be-fsstubs.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/backend/libpq/be-fsstubs.c b/src/backend/libpq/be-fsstubs.c
index 5267cf40abe..82806bdbe90 100644
--- a/src/backend/libpq/be-fsstubs.c
+++ b/src/backend/libpq/be-fsstubs.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.22 1998/07/21 04:17:23 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.23 1998/07/22 05:48:59 vadim Exp $
*
* NOTES
* This should be moved to a more appropriate place. It is here
@@ -375,14 +375,18 @@ lo_export(Oid lobjId, text *filename)
void
_lo_commit(void)
{
- int i;
+ int i;
MemoryContext currentContext;
+ if (fscxt == NULL)
+ return;
+
currentContext = MemoryContextSwitchTo((MemoryContext) fscxt);
- for (i = 0; i < MAX_LOBJ_FDS; i++) {
- if (cookies[i] != NULL) inv_cleanindex(cookies[i]);
- }
+ for (i = 0; i < MAX_LOBJ_FDS; i++)
+ {
+ if (cookies[i] != NULL) inv_cleanindex(cookies[i]);
+ }
MemoryContextSwitchTo(currentContext);