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

index 5af6ff790b261ab7f4f4438a2b0b20cea564536f..b035783246bd432b57a90bed0ed22e059d14c0ec 100755 (executable)
@@ -2168,7 +2168,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);
 }