From: Ilia Alshanetsky Date: Tue, 20 Dec 2005 14:50:12 +0000 (+0000) Subject: Proper error handling for persistent connections. X-Git-Tag: php-5.1.2RC1~36 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5961160f95b83d55feba5d6afe56f60106e1b39c;p=php Proper error handling for persistent connections. --- diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c index d53dfa8c1a..cf0a51d59b 100644 --- a/ext/pdo_sqlite/sqlite_driver.c +++ b/ext/pdo_sqlite/sqlite_driver.c @@ -43,9 +43,9 @@ int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int li if (einfo->errcode != SQLITE_OK) { if (einfo->errmsg) { - efree(einfo->errmsg); + pefree(einfo->errmsg, dbh->is_persistent); } - einfo->errmsg = estrdup((char*)sqlite3_errmsg(H->db)); + einfo->errmsg = pestrdup((char*)sqlite3_errmsg(H->db), dbh->is_persistent); } else { /* no error */ strcpy(*pdo_err, PDO_ERR_NONE); return 0; @@ -144,7 +144,7 @@ static int sqlite_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */ H->db = NULL; } if (einfo->errmsg) { - efree(einfo->errmsg); + pefree(einfo->errmsg, dbh->is_persistent); einfo->errmsg = NULL; } pefree(H, dbh->is_persistent);