]> granicus.if.org Git - php/commitdiff
MFH: fix possible crash in free_statement()
authorAntony Dovgal <tony2001@php.net>
Wed, 23 Aug 2006 19:15:57 +0000 (19:15 +0000)
committerAntony Dovgal <tony2001@php.net>
Wed, 23 Aug 2006 19:15:57 +0000 (19:15 +0000)
ext/pdo/pdo_stmt.c

index 94b5a2932feb1c0720c37929589a99f5329c0462..db46b950b817dcec1caeaa060c288e4c0bd8d6f0 100755 (executable)
@@ -2272,7 +2272,9 @@ static void free_statement(pdo_stmt_t *stmt TSRMLS_DC)
        do_fetch_opt_finish(stmt, 1 TSRMLS_CC);
 
        zend_objects_store_del_ref(&stmt->database_object_handle TSRMLS_CC);
-       php_pdo_dbh_delref(stmt->dbh TSRMLS_CC);
+       if (stmt->dbh) {
+               php_pdo_dbh_delref(stmt->dbh TSRMLS_CC);
+       }
        efree(stmt);
 }