Permalink
Browse files

Minimize stack usage and added missing dtors

  • Loading branch information...
1 parent 409022b commit d091516c31801dadfec242a65a2859f38cd1e08b Ilia Alshanetsky committed Aug 9, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 ext/standard/dns.c
View
@@ -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();

0 comments on commit d091516

Please sign in to comment.