]> granicus.if.org Git - php/commitdiff
hmmm
authorWez Furlong <wez@php.net>
Sun, 6 Feb 2005 23:58:53 +0000 (23:58 +0000)
committerWez Furlong <wez@php.net>
Sun, 6 Feb 2005 23:58:53 +0000 (23:58 +0000)
ext/pdo_firebird/firebird_statement.c

index 7242ccfb682e1158c4cfe89cb98166acad3c63bc..144dc9458085f7c83ef6392a5bab51d409723001 100644 (file)
@@ -520,6 +520,7 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
        switch (event_type) {
                char *value;
                unsigned long value_len;
+               int caller_frees;
                        
                case PDO_PARAM_EVT_ALLOC:
                        if (param->is_param) {
@@ -601,8 +602,9 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
                case PDO_PARAM_EVT_FETCH_POST:
                        value = NULL;
                        value_len = 0;
+                       caller_frees = 0;
                        
-                       if (firebird_stmt_get_col(stmt, param->paramno, &value, &value_len TSRMLS_CC)) {
+                       if (firebird_stmt_get_col(stmt, param->paramno, &value, &value_len, &caller_frees TSRMLS_CC)) {
                                switch (param->param_type) {
                                        case PDO_PARAM_STR:
                                                if (value) {
@@ -624,6 +626,9 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
                                        default:
                                                ZVAL_NULL(param->parameter);
                                }
+                               if (value && caller_frees) {
+                                       efree(value);
+                               }
                                return 1;
                        }
                        return 0;