fix leak; fix test
authorMichael Wallner <mike@php.net>
Wed, 17 Dec 2014 07:38:31 +0000 (08:38 +0100)
committerMichael Wallner <mike@php.net>
Wed, 17 Dec 2014 07:38:31 +0000 (08:38 +0100)
src/php_pqstm.c
tests/crash_txn_reverse_dep.phpt

index f6da0672f40ceac17de684aef0b8cb51abd03599..0dd2ebc50cd2532e027ef94762e9ce2f2e4ed8b8 100644 (file)
@@ -79,6 +79,7 @@ static void php_pqstm_object_free(void *o TSRMLS_DC)
                        php_pq_object_delref(obj->intern->conn TSRMLS_CC);
                }
                efree(obj->intern->name);
+               efree(obj->intern->query);
                zend_hash_destroy(&obj->intern->bound);
                if (obj->intern->params) {
                        php_pq_params_free(&obj->intern->params);
index 7c9e8fc744dae88e0bceee4eb7c6d90d016619d1..d1a5cf181527d1e6dd570720f7b15aafd9babbc4 100644 (file)
@@ -11,7 +11,7 @@ echo "Test\n";
 include "_setup.inc";
 
 $c = new pq\Connection(PQ_DSN);
-$c->c = $c->declare("test", "SELECT 1");
+$c->c = $c->declare("test", pq\Cursor::WITH_HOLD, "SELECT 1");
 
 ?>
 ===DONE===