1
0
mirror of https://github.com/danog/ext-pq.git synced 2024-12-02 09:18:02 +01:00

fix NULL deref with circular refs

This commit is contained in:
Michael Wallner 2014-12-03 11:04:55 +01:00
parent c223e1c70b
commit 863e93c99c
2 changed files with 2 additions and 2 deletions

View File

@ -31,7 +31,7 @@ static HashTable php_pqcur_object_prophandlers;
static void cur_close(php_pqcur_object_t *obj TSRMLS_DC) static void cur_close(php_pqcur_object_t *obj TSRMLS_DC)
{ {
if (obj->intern->open) { if (obj->intern->open && obj->intern->conn->intern) {
PGresult *res; PGresult *res;
smart_str cmd = {0}; smart_str cmd = {0};

View File

@ -54,7 +54,7 @@ static void php_pqtxn_object_free(void *o TSRMLS_DC)
fprintf(stderr, "FREE txn(#%d) %p (conn(#%d): %p)\n", obj->zv.handle, obj, obj->intern->conn->zv.handle, obj->intern->conn); fprintf(stderr, "FREE txn(#%d) %p (conn(#%d): %p)\n", obj->zv.handle, obj, obj->intern->conn->zv.handle, obj->intern->conn);
#endif #endif
if (obj->intern) { if (obj->intern) {
if (obj->intern->open) { if (obj->intern->open && obj->intern->conn->intern) {
PGresult *res = PQexec(obj->intern->conn->intern->conn, "ROLLBACK"); PGresult *res = PQexec(obj->intern->conn->intern->conn, "ROLLBACK");
if (res) { if (res) {