[php-src] master: ext/standard: Free Windows DNS query results
| From: | Ilia Alshanetsky | Date: | Thu, 29 Oct 2026 19:07:26 +0000 |
| Subject: | [php-src] master: ext/standard: Free Windows DNS query results | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-142958@lists.php.net to get a copy of this message | ||
Author: Ilia Alshanetsky (iliaal)
Date: 2026-10-29T14:47:43-04:00
Commit: https://github.com/php/php-src/commit/b175769022010659c721705ef1c12922f6c00e53
Raw diff: https://github.com/php/php-src/commit/b175769022010659c721705ef1c12922f6c00e53.diff
ext/standard: Free Windows DNS query results
Successful checkdnsrr() and dns_check_record() calls retain their native DNS
record lists. Release the list before returning.
Closes GH-25035
Changed paths:
M NEWS
M ext/standard/dns_win32.c
Diff:
diff --git a/NEWS b/NEWS
index 6532e3985947..de5109dd05ce 100644
--- a/NEWS
+++ b/NEWS
@@ -236,6 +236,8 @@ PHP NEWS
properties). (Lazizbek Ergashev)
- Standard:
+ . Fixed memory leaks in checkdnsrr() and dns_check_record() on Windows.
+ (Ilia Alshanetsky)
. Fixed bug GH-24308 (Request shutdown calls closelog() even when syslog
was not opened by PHP). (lazerg)
. Fixed bug GH-24399 (usleep() and time_nanosleep() ignore queued APCs on
diff --git a/ext/standard/dns_win32.c b/ext/standard/dns_win32.c
index 4eb4b0e6e559..96a5e8562511 100644
--- a/ext/standard/dns_win32.c
+++ b/ext/standard/dns_win32.c
@@ -137,6 +137,8 @@ PHP_FUNCTION(dns_check_record)
RETURN_FALSE;
}
+ DnsRecordListFree(pResult, DnsFreeRecordListDeep);
+
RETURN_TRUE;
}
/* }}} */