summaryrefslogtreecommitdiff
path: root/ext/sqlite/sqlite.c
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2003-06-26 19:07:17 +0000
committerMarcus Boerger <helly@php.net>2003-06-26 19:07:17 +0000
commitbbfa7cae2553325dd1bc377d4a64bccf67c30d14 (patch)
tree98b04fb49c52ac7ff9637eee8d91d37951a22e56 /ext/sqlite/sqlite.c
parent8e0516c9901e35a3acc4e3df731b517b063a8534 (diff)
downloadphp-git-bbfa7cae2553325dd1bc377d4a64bccf67c30d14.tar.gz
Fix memleak
Diffstat (limited to 'ext/sqlite/sqlite.c')
-rw-r--r--ext/sqlite/sqlite.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c
index 4c979d146a..5e4ebc0ebc 100644
--- a/ext/sqlite/sqlite.c
+++ b/ext/sqlite/sqlite.c
@@ -1030,6 +1030,9 @@ PHP_FUNCTION(sqlite_popen)
&filename, &filename_len, &mode, &errmsg)) {
return;
}
+ if (errmsg) {
+ zval_dtor(errmsg);
+ }
if (strncmp(filename, ":memory:", sizeof(":memory:") - 1)) {
/* resolve the fully-qualified path name to use as the hash key */
@@ -1095,6 +1098,9 @@ PHP_FUNCTION(sqlite_open)
php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
return;
}
+ if (errmsg) {
+ zval_dtor(errmsg);
+ }
if (strncmp(filename, ":memory:", sizeof(":memory:") - 1)) {
if (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
@@ -1137,6 +1143,9 @@ PHP_FUNCTION(sqlite_factory)
php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
RETURN_NULL();
}
+ if (errmsg) {
+ zval_dtor(errmsg);
+ }
if (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);