projects
/
users
/
gsingh
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
445dbd8
)
Revert "PL/Python: Fix potential NULL pointer dereference"
author
Peter Eisentraut
<peter_e@gmx.net>
Tue, 28 Nov 2017 18:55:39 +0000
(13:55 -0500)
committer
Peter Eisentraut
<peter_e@gmx.net>
Tue, 28 Nov 2017 18:55:39 +0000
(13:55 -0500)
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.
src/pl/plpython/plpy_spi.c
patch
|
blob
|
blame
|
history
diff --git
a/src/pl/plpython/plpy_spi.c
b/src/pl/plpython/plpy_spi.c
index c80ccf6129b2b2d4a0c2a620d1f0c27fb7aff169..ade27f3924210b2f8a622762e53ade0f4ad0f64f 100644
(file)
--- 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
{