diff options
author | Sara Golemon <pollita@php.net> | 2002-11-23 01:09:07 +0000 |
---|---|---|
committer | Sara Golemon <pollita@php.net> | 2002-11-23 01:09:07 +0000 |
commit | e9047df607fafc5964e50ea3fc21f6ddd459ba15 (patch) | |
tree | a8b26e0b858355a25505375aa1d8ec6309d84725 | |
parent | 318e561905ab5e401d9e7ea828eae966a59e3df3 (diff) | |
download | php-git-e9047df607fafc5964e50ea3fc21f6ddd459ba15.tar.gz |
New function dns_get_record(): close resolver socket after use.
fix to internal func php_parserr(): correct bug in return state.
-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 cb68897944..cd55fb3618 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -331,8 +331,9 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int GETLONG(ttl, cp); GETSHORT(dlen, cp); if (type_to_fetch != T_ANY && type != type_to_fetch) { - /* Should never actually occour */ - return NULL; + *subarray = NULL; + cp += dlen; + return cp; } if (!store) { @@ -576,6 +577,7 @@ PHP_FUNCTION(dns_get_record) zend_hash_next_index_insert(HASH_OF(return_value), (void *)&subarray[current_subarray], sizeof(zval *), NULL); current_subarray++; } + res_nclose(&res); } } |