]> granicus.if.org Git - php/commitdiff
Minimize stack usage and added missing dtors
authorIlia Alshanetsky <iliaa@php.net>
Tue, 9 Aug 2011 13:10:57 +0000 (13:10 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 9 Aug 2011 13:10:57 +0000 (13:10 +0000)
ext/standard/dns.c

index 3f740232be83ebc4f499487524ed29c5fe7a625e..dc0ab59367ddc23bc91ddcc72411b98baa0482a9 100644 (file)
@@ -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();