--- a/ext/sqlite/sqlite.c
+++ b/ext/sqlite/sqlite.c
@@ -1641,8 +1641,10 @@ PHP_FUNCTION(sqlite_open)
 	}
 
 	if (strlen(filename) != filename_len) {
+		zend_restore_error_handling(&error_handling TSRMLS_CC);
 		RETURN_FALSE;
 	}
+
 	if (strncmp(filename, ":memory:", sizeof(":memory:") - 1)) {
 		/* resolve the fully-qualified path name to use as the hash key */
 		if (!(fullpath = expand_filepath(filename, NULL TSRMLS_CC))) {
@@ -1697,6 +1699,7 @@ PHP_FUNCTION(sqlite_factory)
 	}
 
 	if (strlen(filename) != filename_len) {
+		zend_restore_error_handling(&error_handling TSRMLS_CC);
 		RETURN_FALSE;
 	}
 
--- /dev/null
+++ b/ext/soap/tests/error_handler.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #46760 (SoapClient doRequest fails when proxy is used)
+--SKIPIF--
+<?php require_once('skipif.inc'); 
+if (!extension_loaded('sqlite')) die('skip squilite extension not available');
+?>
+--FILE--
+<?php
+echo "blllllllllaaaaaaa\n";
+$var475 = sqlite_factory("\x00");
+$var147 = use_soap_error_handler();
+$var477 = flock(false,false);dump($client->_proxy_port);
+
+echo "OK";
+?>
+--EXPECT--
+OK
--- a/ext/xsl/xsltprocessor.c
+++ b/ext/xsl/xsltprocessor.c
@@ -643,6 +643,7 @@ PHP_FUNCTION(xsl_xsltprocessor_transform
 	ret = -1;
 	if (newdocp) {
 		if (strlen(uri) != uri_len) {
+			xmlFreeDoc(newdocp);
 			RETURN_FALSE;
 		}
 		ret = xsltSaveResultToFilename(uri, newdocp, sheetp, 0);
--- a/ext/pspell/pspell.c
+++ b/ext/pspell/pspell.c
@@ -403,6 +403,7 @@ static PHP_FUNCTION(pspell_new_personal)
 #endif
 
 	if (strlen(personal) != personal_len) {
+		delete_pspell_config(config);
 		RETURN_FALSE;
 	}
 
