Skip to content

Commit 2a67742

Browse files
committed
Fix _lo_commit: core if LO memmory context was not created (LO were not used?)
1 parent 5afe171 commit 2a67742

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/backend/libpq/be-fsstubs.c

+9-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.22 1998/07/21 04:17:23 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.23 1998/07/22 05:48:59 vadim Exp $
1111
*
1212
* NOTES
1313
* This should be moved to a more appropriate place. It is here
@@ -375,14 +375,18 @@ lo_export(Oid lobjId, text *filename)
375375
void
376376
_lo_commit(void)
377377
{
378-
int i;
378+
int i;
379379
MemoryContext currentContext;
380380

381+
if (fscxt == NULL)
382+
return;
383+
381384
currentContext = MemoryContextSwitchTo((MemoryContext) fscxt);
382385

383-
for (i = 0; i < MAX_LOBJ_FDS; i++) {
384-
if (cookies[i] != NULL) inv_cleanindex(cookies[i]);
385-
}
386+
for (i = 0; i < MAX_LOBJ_FDS; i++)
387+
{
388+
if (cookies[i] != NULL) inv_cleanindex(cookies[i]);
389+
}
386390

387391
MemoryContextSwitchTo(currentContext);
388392

0 commit comments

Comments
 (0)