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.
This commit is contained in:
parent
445dbd82a3
commit
62546b4357
@ -361,10 +361,7 @@ PLy_spi_execute_fetch_result(SPITupleTable *tuptable, uint64 rows, int status)
|
|||||||
|
|
||||||
result = (PLyResultObject *) PLy_result_new();
|
result = (PLyResultObject *) PLy_result_new();
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
|
||||||
SPI_freetuptable(tuptable);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
Py_DECREF(result->status);
|
Py_DECREF(result->status);
|
||||||
result->status = PyInt_FromLong(status);
|
result->status = PyInt_FromLong(status);
|
||||||
|
|
||||||
@ -417,9 +414,7 @@ PLy_spi_execute_fetch_result(SPITupleTable *tuptable, uint64 rows, int status)
|
|||||||
if (!result->rows)
|
if (!result->rows)
|
||||||
{
|
{
|
||||||
Py_DECREF(result);
|
Py_DECREF(result);
|
||||||
MemoryContextDelete(cxt);
|
result = NULL;
|
||||||
SPI_freetuptable(tuptable);
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user