Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 62546b4

Browse files
committed
Revert "PL/Python: Fix potential NULL pointer dereference"
This reverts commit e42e2f3. It's not safe to return in the middle of a PG_TRY block, so this will have to be done differently.
1 parent 445dbd8 commit 62546b4

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/pl/plpython/plpy_spi.c

+1-6
Original file line numberDiff line numberDiff line change
@@ -361,10 +361,7 @@ PLy_spi_execute_fetch_result(SPITupleTable *tuptable, uint64 rows, int status)
361361

362362
result = (PLyResultObject *) PLy_result_new();
363363
if (!result)
364-
{
365-
SPI_freetuptable(tuptable);
366364
return NULL;
367-
}
368365
Py_DECREF(result->status);
369366
result->status = PyInt_FromLong(status);
370367

@@ -417,9 +414,7 @@ PLy_spi_execute_fetch_result(SPITupleTable *tuptable, uint64 rows, int status)
417414
if (!result->rows)
418415
{
419416
Py_DECREF(result);
420-
MemoryContextDelete(cxt);
421-
SPI_freetuptable(tuptable);
422-
return NULL;
417+
result = NULL;
423418
}
424419
else
425420
{

0 commit comments

Comments
 (0)