diff options
author | Felipe Pena <felipe@php.net> | 2008-12-02 21:01:37 +0000 |
---|---|---|
committer | Felipe Pena <felipe@php.net> | 2008-12-02 21:01:37 +0000 |
commit | 00cb5de0ab834ba1d989590ea33c57e891b1dbe5 (patch) | |
tree | 666985b5c6e58a5646d1b67db25447fac53af777 /ext/pdo_sqlite/sqlite_driver.c | |
parent | 7a28b876e4c7c5d5ba40e34b8616ef6a8e31caf1 (diff) | |
download | php-git-00cb5de0ab834ba1d989590ea33c57e891b1dbe5.tar.gz |
MFH:
- Fixed memory leaks
- Added new tests (Coverage++)
Diffstat (limited to 'ext/pdo_sqlite/sqlite_driver.c')
-rw-r--r-- | ext/pdo_sqlite/sqlite_driver.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c index b03a8bcbdd..9a7ff54cbb 100644 --- a/ext/pdo_sqlite/sqlite_driver.c +++ b/ext/pdo_sqlite/sqlite_driver.c @@ -368,8 +368,8 @@ static int do_callback(struct pdo_sqlite_fci *fc, zval *cb, } /* clean up the params */ - if (argc) { - for (i = is_agg; i < argc; i++) { + if (zargs) { + for (i = is_agg; i < fake_argc; i++) { zval_ptr_dtor(zargs[i]); efree(zargs[i]); } @@ -498,6 +498,7 @@ static PHP_METHOD(SQLite, sqliteCreateFunction) MAKE_STD_ZVAL(func->func); *(func->func) = *callback; zval_copy_ctor(func->func); + INIT_PZVAL(func->func); func->argc = argc; @@ -576,10 +577,12 @@ static PHP_METHOD(SQLite, sqliteCreateAggregate) MAKE_STD_ZVAL(func->step); *(func->step) = *step_callback; zval_copy_ctor(func->step); + INIT_PZVAL(func->step); MAKE_STD_ZVAL(func->fini); *(func->fini) = *fini_callback; zval_copy_ctor(func->fini); + INIT_PZVAL(func->fini); func->argc = argc; |