diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2011-08-09 13:10:57 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2011-08-09 13:10:57 +0000 |
commit | d091516c31801dadfec242a65a2859f38cd1e08b (patch) | |
tree | 360c627bb68dcc8a7005ce88f8673a73d69bccf6 /ext/standard/dns.c | |
parent | 409022b742ac59cd810e51ee7224976104f5008b (diff) | |
download | php-git-d091516c31801dadfec242a65a2859f38cd1e08b.tar.gz |
Minimize stack usage and added missing dtors
Diffstat (limited to 'ext/standard/dns.c')
-rw-r--r-- | ext/standard/dns.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/standard/dns.c b/ext/standard/dns.c index 6efc1c0d58..9373e87560 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; @@ -794,12 +794,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(); |