summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2011-08-09 13:10:57 +0000
committerIlia Alshanetsky <iliaa@php.net>2011-08-09 13:10:57 +0000
commit521ce498194f1ed2e33d7f65e2d250e3a0a1d9e3 (patch)
treea333fee97aab76d165252142e4dc948ce138e0d6
parent5dc319589770ef5471f8e86951118794a0368f93 (diff)
downloadphp-git-521ce498194f1ed2e33d7f65e2d250e3a0a1d9e3.tar.gz
Minimize stack usage and added missing dtors
-rw-r--r--ext/standard/dns.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/standard/dns.c b/ext/standard/dns.c
index 3f740232be..dc0ab59367 100644
--- a/ext/standard/dns.c
+++ b/ext/standard/dns.c
@@ -118,7 +118,7 @@ static char *php_gethostbyname(char *name);
Get the host name of the current machine */
PHP_FUNCTION(gethostname)
{
- char buf[4096];
+ char buf[MAXHOSTNAMELEN];
if (zend_parse_parameters_none() == FAILURE) {
return;
@@ -830,12 +830,14 @@ PHP_FUNCTION(dns_get_record)
#if defined(HAVE_DNS_SEARCH)
handle = dns_open(NULL);
if (handle == NULL) {
+ zval_dtor(return_value);
RETURN_FALSE;
}
#elif defined(HAVE_RES_NSEARCH)
memset(&state, 0, sizeof(state));
if (res_ninit(handle)) {
- RETURN_FALSE;
+ zval_dtor(return_value);
+ RETURN_FALSE;
}
#else
res_init();