]> granicus.if.org Git - php/commitdiff
Fix memleak
authorMarcus Boerger <helly@php.net>
Thu, 26 Jun 2003 19:07:17 +0000 (19:07 +0000)
committerMarcus Boerger <helly@php.net>
Thu, 26 Jun 2003 19:07:17 +0000 (19:07 +0000)
ext/sqlite/sqlite.c

index 4c979d146abc9ba300de38b0bfebf9dbf7b47748..5e4ebc0ebcd78776836b6da3ff88fe4d797721d1 100644 (file)
@@ -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);