]> granicus.if.org Git - php/commitdiff
- Fix remaining memleaks
authorMarcus Boerger <helly@php.net>
Mon, 31 Oct 2005 07:47:40 +0000 (07:47 +0000)
committerMarcus Boerger <helly@php.net>
Mon, 31 Oct 2005 07:47:40 +0000 (07:47 +0000)
# all tests pass for me now for the first time in:
# pgsql, mysql, sqlite, sqlite2

ext/pdo/pdo_stmt.c

index bf83c703acbd6c84f1859dd604042eb868187207..41ba56c33c168e65130df74632c90cf9bae993bb 100755 (executable)
@@ -1055,6 +1055,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value,
                                        } else {
                                                *return_value = *retval;
                                                zval_copy_ctor(return_value);
+                                               INIT_PZVAL(return_value);
                                                zval_ptr_dtor(&retval);
                                        }
                                }
@@ -1401,7 +1402,9 @@ static PHP_METHOD(PDOStatement, fetchAll)
                if (error != 2) {
                        RETURN_FALSE;
                } else { /* on no results, return an empty array */
-                       array_init(return_value);
+                       if (Z_TYPE_P(return_value) != IS_ARRAY) {
+                               array_init(return_value);
+                       }
                        return;
                }
        }