Index: oci_statement.c =================================================================== RCS file: /repository/php-src/ext/pdo_oci/oci_statement.c,v retrieving revision 1.16.2.10.2.7.2.1 diff -u -r1.16.2.10.2.7.2.1 oci_statement.c --- oci_statement.c 31 Dec 2007 07:17:12 -0000 1.16.2.10.2.7.2.1 +++ oci_statement.c 20 Jul 2008 20:29:10 -0000 @@ -87,7 +87,7 @@ } if (S->einfo.errmsg) { - efree(S->einfo.errmsg); + pefree(S->einfo.errmsg, stmt->dbh->is_persistent); S->einfo.errmsg = NULL; } Index: tests/bug_44301.phpt =================================================================== RCS file: tests/bug_44301.phpt diff -N tests/bug_44301.phpt --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ tests/bug_44301.phpt 20 Jul 2008 20:29:10 -0000 @@ -0,0 +1,25 @@ +--TEST-- +PDO OCI Bug #44301 (Segfault when an exception is thrown on persistent connections) +--SKIPIF-- + +--FILE-- + true))); +require 'ext/pdo/tests/pdo_test.inc'; +$db = PDOTest::test_factory('ext/pdo_oci/tests/common.phpt'); +$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + +try { + $stmt = $db->prepare('SELECT * FROM no_table'); + $stmt->execute(); +} catch (PDOException $e) { + print $e->getMessage(); +} +$db = null; +--EXPECTF-- +SQLSTATE[HY000]: General error: 942 OCIStmtExecute: ORA-00942: table or view does not exist + (%s/ext/pdo_oci/oci_statement.c:%d)