diff options
author | Wez Furlong <wez@php.net> | 2003-04-17 16:36:59 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2003-04-17 16:36:59 +0000 |
commit | 28128e415487d15b745655a67d0163e5af8aaefe (patch) | |
tree | 880882883bc61f6a256c61bdaeb3e91be64e12ac /ext/sqlite/sqlite.c | |
parent | 5be2fe410ef6f52c4fa9bd8b17489df738128734 (diff) | |
download | php-git-28128e415487d15b745655a67d0163e5af8aaefe.tar.gz |
Segfault fixing!
Diffstat (limited to 'ext/sqlite/sqlite.c')
-rw-r--r-- | ext/sqlite/sqlite.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c index 3dd5211f5f..0a799a71a8 100644 --- a/ext/sqlite/sqlite.c +++ b/ext/sqlite/sqlite.c @@ -131,8 +131,7 @@ static void php_sqlite_function_callback(sqlite_func *func, int argc, const char for (i = 0; i < argc-1; i++) { zargs[i] = emalloc(sizeof(zval *)); MAKE_STD_ZVAL(*zargs[i]); - - ZVAL_STRING(*zargs[i], (char*)argv[i+1], 0); + ZVAL_STRING(*zargs[i], (char*)argv[i+1], 1); } } @@ -174,11 +173,14 @@ static void php_sqlite_function_callback(sqlite_func *func, int argc, const char if (zargs) { for (i = 0; i < argc-1; i++) { + zval_ptr_dtor(zargs[i]); efree(zargs[i]); } efree(zargs); } } + + PHP_MINIT_FUNCTION(sqlite) { le_sqlite_db = zend_register_list_destructors_ex(php_sqlite_db_dtor, NULL, "sqlite database", module_number); @@ -273,7 +275,7 @@ PHP_FUNCTION(sqlite_query) long sql_len; struct php_sqlite_result res, *rres; int ret; - char *errtext; + char *errtext = NULL; if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sr", &sql, &sql_len, &zdb)) { return; |