Commit 62546b43 authored by Peter Eisentraut's avatar Peter Eisentraut

Revert "PL/Python: Fix potential NULL pointer dereference"

This reverts commit e42e2f38.

It's not safe to return in the middle of a PG_TRY block, so this will
have to be done differently.
parent 445dbd82
......@@ -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
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment