aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2017-11-28 13:55:39 -0500
committerPeter Eisentraut <peter_e@gmx.net>2017-11-28 13:55:39 -0500
commit62546b4357f2aec46bb896fdbddfc0904a2d7920 (patch)
tree5f6834d3a0617f0de4cf5e36af82a21db9f4ee0b
parent445dbd82a3192c6f4d15de012333943882020904 (diff)
downloadpostgresql-62546b4357f2aec46bb896fdbddfc0904a2d7920.tar.gz
postgresql-62546b4357f2aec46bb896fdbddfc0904a2d7920.zip
Revert "PL/Python: Fix potential NULL pointer dereference"
This reverts commit e42e2f38907681c48c43f49c5ec9f9f41a9aa9a5. It's not safe to return in the middle of a PG_TRY block, so this will have to be done differently.
-rw-r--r--src/pl/plpython/plpy_spi.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/pl/plpython/plpy_spi.c b/src/pl/plpython/plpy_spi.c
index c80ccf6129b..ade27f39242 100644
--- a/src/pl/plpython/plpy_spi.c
+++ b/src/pl/plpython/plpy_spi.c
@@ -361,10 +361,7 @@ PLy_spi_execute_fetch_result(SPITupleTable *tuptable, uint64 rows, int status)
result = (PLyResultObject *) PLy_result_new();
if (!result)
- {
- SPI_freetuptable(tuptable);
return NULL;
- }
Py_DECREF(result->status);
result->status = PyInt_FromLong(status);
@@ -417,9 +414,7 @@ PLy_spi_execute_fetch_result(SPITupleTable *tuptable, uint64 rows, int status)
if (!result->rows)
{
Py_DECREF(result);
- MemoryContextDelete(cxt);
- SPI_freetuptable(tuptable);
- return NULL;
+ result = NULL;
}
else
{