free errmsg & prevent leaks

This commit is contained in:
Antony Dovgal 2005-02-14 13:31:34 +00:00
parent ff23184893
commit 7d4bf3ccd9
2 changed files with 16 additions and 1 deletions

View File

@ -63,6 +63,11 @@ ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what, swor
einfo = &H->einfo;
if (einfo->errmsg) {
pefree(einfo->errmsg, dbh->is_persistent);
einfo->errmsg = NULL;
}
if (stmt) {
S = (pdo_oci_stmt*)stmt->driver_data;
einfo = &S->einfo;
@ -184,7 +189,12 @@ static int oci_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
OCIHandleFree(H->env, OCI_HTYPE_ENV);
H->env = NULL;
}
if (H->einfo.errmsg) {
pefree(H->einfo.errmsg, dbh->is_persistent);
H->einfo.errmsg = NULL;
}
pefree(H, dbh->is_persistent);
return 0;

View File

@ -81,6 +81,11 @@ static int oci_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
stmt->bound_params = NULL;
}
if (S->einfo.errmsg) {
efree(S->einfo.errmsg);
S->einfo.errmsg = NULL;
}
if (S->cols) {
for (i = 0; i < stmt->column_count; i++) {
if (S->cols[i].data) {